0

I have Laravel framework v5.8.29.

And I can't run artisan command in a unit test either using $this->artisan() nor Artisan::call().

migrate command prints absolutely nothing.

It seems like the command just even was not called!

But it works pretty well if I call the command from the system, using php artisan migrate.

Example: https://travis-ci.com/github/CaliforniaMountainSnake/laravel-database-test-case/builds/171804872

As you can see, at first I call php artisan migrate directly and it works as expected. But then I call the same command from the unit test and it just doesn't work. A second time I call migrate command with another empty database, so the first call doesn't affect the second (You can see the proof of that, TABLES of "test_mysql" returns nothing).

James Bond
  • 2,229
  • 1
  • 15
  • 26
  • Check this article. I hope it'll solve your proble. https://stackoverflow.com/questions/41615268/run-artisan-command-from-php-function – MeGaZ Jun 18 '20 at 08:43
  • MeGaZ, I already found that command actually runs, but doesn't produce any output: https://github.com/laravel/framework/discussions/33242 This is strange behavior, you can see this in this library: https://travis-ci.com/github/CaliforniaMountainSnake/laravel-database-test-case – James Bond Jun 18 '20 at 18:51

0 Answers0