Provide database migration for running tests.
Closed this issue ยท 3 comments
๐๐ฝ hi there !
Thanks for this cool package !
I have written something similar in the past, but your package is much more elaborated ๐๐ฝ
I would like to tinker a bit and maybe contribute some small things.
But it seems I'm unable to successfully run the tests.
I see your migration test file is not included in the source code, is there any reason for this ?
public function getEnvironmentSetUp($app)
{
config()->set('database.default', 'testing');
$migration = include __DIR__ . '/../database/migrations/create_laravel-dynamic-model_table.php.stub';
$migration->up();
}
I already tried to reverse engineer the migrations file, but still not all test are passing.
Would it be possible for you to provide the migrations structure ?
cheers !
Hi @dreammonkey, thanks for you kind words!
It would love to see a contribution for this package. Especially the migration to Laravel 11 (which removed dectrine/dbal). Thats why the migration to Laravel 11 is not so easy...
Regarding to your question:
You do not need the environment setup. As you can see in the phpunit.xml.dist
you just need to make sure, that the mysql connection is working. Means you need a db called laravel_schema_rules
and a user with a password. Also as you can see in the tests, all tables need for the tests are created "on the fly". If I run composer test
all tests are running and are passing.
Thanks !
Ok I see, I was too quick to open this issue.
I didn't know about the doctrine/dbal issue. I guess it's not as easy as _simply specifying it as a dependency of this package ?
I need to revisit this tomorrow, but it seems the dbal issue is not that big a deal, again I need to double check this tomorrow..