2016-12-29 16:35:34 +01:00
|
|
|
<?php
|
2016-02-19 23:31:29 +01:00
|
|
|
$I = new AcceptanceTester($scenario);
|
|
|
|
|
|
|
|
$I->wantTo('generate a seeder with default options');
|
|
|
|
$I->runShellCommand('php artisan wn:seeder "App\Task"');
|
2016-02-20 00:04:30 +01:00
|
|
|
$I->seeInShellOutput('TasksTableSeeder generated');
|
2016-02-19 23:31:29 +01:00
|
|
|
$I->openFile('./database/seeds/TasksTableSeeder.php');
|
|
|
|
$I->seeInThisFile('
|
|
|
|
use Illuminate\Database\Seeder;
|
|
|
|
|
|
|
|
class TasksTableSeeder extends Seeder
|
|
|
|
{
|
|
|
|
public function run()
|
|
|
|
{
|
|
|
|
factory(App\Task::class, 10)->create();
|
|
|
|
}
|
|
|
|
}');
|
|
|
|
$I->deleteFile('./database/seeds/TasksTableSeeder.php');
|
|
|
|
|
|
|
|
$I->wantTo('generate a seeder with custom options');
|
|
|
|
$I->runShellCommand('php artisan wn:seeder "App\Category" --count=25');
|
|
|
|
$I->seeInShellOutput('CategoriesTableSeeder generated');
|
|
|
|
$I->openFile('./database/seeds/CategoriesTableSeeder.php');
|
|
|
|
$I->seeInThisFile('
|
|
|
|
use Illuminate\Database\Seeder;
|
|
|
|
|
|
|
|
class CategoriesTableSeeder extends Seeder
|
|
|
|
{
|
|
|
|
public function run()
|
|
|
|
{
|
2016-02-20 00:04:30 +01:00
|
|
|
factory(App\Category::class, 25)->create();
|
2016-02-19 23:31:29 +01:00
|
|
|
}
|
|
|
|
}');
|
|
|
|
$I->deleteFile('./database/seeds/CategoriesTableSeeder.php');
|