-
3 votesanswersviews
如何在内存数据库中使用sqlite在laravel 5.5中运行unittests
我设置了一个测试数据库: phpunit.xml : <phpunit> <!... other stuff ...> <php> <env name="APP_ENV" value="testing"/> <env name="CACHE_DRI... -
9 votesanswersviews
如何从phpunit test setUp运行laravel数据库播种器?
我试图在一些phpunit teast案例中的每个测试之前重新创建数据库 . 我正在使用laravel 5.3 . 这是TestCase: class CourseTypesTest extends TestCase { public function setUp() { parent::setUp(); Artisan::call('migrate... -
1 votesanswersviews
{closure}()必须是laravel工厂种子上Faker \ Generator \ Generator的一个实例
当我使用php artisan db:seed我收到了错误?在 UserFactory.php line 27: Type error: Argument 1 passed to Illuminate\Database\Eloquent\Factory::{closure}() must be an instance of Faker\Generator\Generator, instance o... -
1 votesanswersviews
Laravel 5.6 db:种子抛出FatalThrowableError:找不到类'APP\Todo'
我正在使用faker生成生成虚假条目并在 php artisan db:seed 的帮助下将其插入数据库中,当我运行此命令时,它显示错误: 播种:TodosTableSeeder Symfony \ Component \ Debug \ Exception \ FatalThrowableError:在/var/www/html/todos/vendor/laravel/framework/s...