When I try to run all my test in laravel with /vendor/bin/phpunit
, I’m getting the following error:
There was 1 error:
1) Tests\Unit\Services\PropertyServiceTest::testCreateProperty
Illuminate\Database\QueryException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'omega-testing.properties' doesn't exist (SQL: insert into `properties` (`name`, `description`, `address_line1`, `length`, `services`, `bathrooms`, `bedrooms`, `price`, `latitude`, `longitude`, `updated_at`, `created_at`) values (Sonny Rutherford, sit sapiente ipsa adipisci debitis, 62895 Gretchen Gardens Suite 795
Harveyburgh, SD 29937-4999, 3.1600498, amet tempore ut voluptatem ut, doloremque debitis sequi quam nemo, 1, 43199635, , , 2018-11-02 01:37:01, 2018-11-02 01:37:01))
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Connection.php:624
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Connection.php:459
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Connection.php:411
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php:32
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2558
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:1318
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:821
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:786
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:649
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:790
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Support/helpers.php:1023
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:791
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:23
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1608
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1620
/Users/jacobotapia/Documents/Espora/omega-webapp/app/Services/PropertyService.php:29
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:223
/Users/jacobotapia/Documents/Espora/omega-webapp/tests/Unit/Services/PropertyServiceTest.php:34
Caused by
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'omega-testing.properties' doesn't exist
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Connection.php:452
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Connection.php:657
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Connection.php:624
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Connection.php:459
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Connection.php:411
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/Processor.php:32
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2558
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:1318
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:821
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:786
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:649
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:790
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Support/helpers.php:1023
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:791
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:23
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1608
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1620
/Users/jacobotapia/Documents/Espora/omega-webapp/app/Services/PropertyService.php:29
/Users/jacobotapia/Documents/Espora/omega-webapp/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:223
/Users/jacobotapia/Documents/Espora/omega-webapp/tests/Unit/Services/PropertyServiceTest.php:34
I have a .env.testing configured which is the following one:
APP_ENV=testing
APP_KEY=base64:6AiBWxoh8mYOTXbDPyVfEQgM4i3A7YoQC0o0x/0m62I=
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=omega-testing
DB_USERNAME=goal
DB_PASSWORD=goal
BCRYPT_ROUNDS=4
CACHE_DRIVER=array
SESSION_DRIVER=array
QUEUE_DRIVER=array
MAIL_DRIVER=array
I don't know why phpunit is not migrating before running the tests. I've tried to make the migrations adding the --env = testing
to the migrate command, and then run the test, but phpunit first delete all the tables and not making the migration again.
I don't know what is happening.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire