PHP code example of vjik / codeception-db-populator
1. Go to this page and download the library: Download vjik/codeception-db-populator library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
final class BlogTest extends Unit
{
public function testCreatePost(): void
{
$this->tester->loadDump('blog');
$this->tester->loadRows('authors');
...
}
}
$I->loadDump('blog'); // load one dump
$I->loadDump('blog', 'catalog'); // load several dumps
$I->loadRows('posts'); // load one set
$I->loadRows('users', 'comments'); // load several sets