orchestral / testbench

Laravel Testing Helper for Packages Development
https://packages.tools/testbench
MIT License
2.11k stars 137 forks source link

ErrorException: Undefined property: stdClass::$migration #225

Closed diegocaprioli closed 6 years ago

diegocaprioli commented 6 years ago

Hello,

I have a simple setUp() method that is failing when calling the method loadMigrationsFrom(). This is my setUp method:

public function setUp()
{
    parent::setUp(); // It seems it calls all the get functions
    //die(file_exists(__DIR__ . '/../../database/migrations'));
    $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations');
}

And I get the following exception:

ErrorException: Undefined property: stdClass::$migration

/home/vagrant/Projects/emovi-sync-app/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2201
/home/vagrant/Projects/emovi-sync-app/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2173
/home/vagrant/Projects/emovi-sync-app/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php:53
/home/vagrant/Projects/emovi-sync-app/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:89
/home/vagrant/Projects/emovi-sync-app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:70
/home/vagrant/Projects/emovi-sync-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29
/home/vagrant/Projects/emovi-sync-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:87
/home/vagrant/Projects/emovi-sync-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:31
/home/vagrant/Projects/emovi-sync-app/vendor/laravel/framework/src/Illuminate/Container/Container.php:564
/home/vagrant/Projects/emovi-sync-app/vendor/laravel/framework/src/Illuminate/Console/Command.php:184
/home/vagrant/Projects/emovi-sync-app/vendor/symfony/console/Command/Command.php:251
/home/vagrant/Projects/emovi-sync-app/vendor/laravel/framework/src/Illuminate/Console/Command.php:171
/home/vagrant/Projects/emovi-sync-app/vendor/symfony/console/Application.php:886
/home/vagrant/Projects/emovi-sync-app/vendor/symfony/console/Application.php:262
/home/vagrant/Projects/emovi-sync-app/vendor/symfony/console/Application.php:145
/home/vagrant/Projects/emovi-sync-app/vendor/laravel/framework/src/Illuminate/Console/Application.php:89
/home/vagrant/Projects/emovi-sync-app/vendor/laravel/framework/src/Illuminate/Console/Application.php:188
/home/vagrant/Projects/emovi-sync-app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:250
/home/vagrant/Projects/emovi-sync-app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithConsole.php:18
/home/vagrant/Projects/emovi-sync-app/vendor/orchestra/testbench-core/src/Database/MigrateProcessor.php:43
/home/vagrant/Projects/emovi-sync-app/vendor/orchestra/testbench-core/src/Concerns/WithLoadMigrationsFrom.php:27
/home/vagrant/Projects/emovi-sync-app/tests/Functional/BaseTestCase.php:15

The migrations directory I'm using exists... so I'm not sure what could be the problem here. Any ideas?

crynobone commented 6 years ago

You need to look/debug your code. Testbench own tests already check and verify that migrations does works without issues.

And I personally have multiple projects using migration without issues.

diegocaprioli commented 6 years ago

I'm sorry I forgot to let you know:

diegocaprioli commented 6 years ago

Yes @crynobone , I have other projects using migrations without issues too. But this was weird enough, ok, I'll try to see if I figure this out on my own...