Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Testbench configuration feature #11595

Merged
merged 3 commits into from
Feb 27, 2024

Conversation

crynobone
Copy link
Contributor

@crynobone crynobone commented Feb 27, 2024

This fixes Laravel 11 tests

@@ -49,12 +51,7 @@ protected function getPackageProviders($app): array
];
}

protected function defineDatabaseMigrations(): void
{
$this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using this causes Laravel to migrate the database twice, using RefreshDatabase trait (which starts a database transaction) and explicitly via loadMigrationsFrom().

Using testbench.yaml configurations only registers the paths to Migrator and runs the migration once via RefreshDatabase eliminating the issue introduced by caching PDO instances between tests: laravel/framework#47912

- tests/database/migrations

workbench:
install: true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having install: true and migrations other than false will migrate the default laravel migrations. Which means we no longer requires create_password_reset_tokens_table and create_users_table.

@danharrin danharrin merged commit 5fc7fbe into filamentphp:laravel-11 Feb 27, 2024
10 checks passed
@danharrin
Copy link
Member

Very helpful, thank you very much!

@crynobone crynobone deleted the laravel-11 branch February 28, 2024 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants