roundly-consulting/testing-for-laravel
A Laravel testing package that provides practical helpers and assertions to streamline feature and unit tests. It reduces boilerplate and makes it easier to write clear, reliable tests for Laravel applications, from HTTP interactions to application behavior.
PackageTestCase in your package’s test suite.migrationSources() in your test case. Return the paths to your package migrations (e.g. __DIR__.'/../database/migrations').migrationSources() empty—tests still run with a drop-per-test reset.migrationSources() and call keepsMigratedSchema() in setUp() to migrate once and reuse the schema across tests for speed.keepsMigratedSchema(). Rely on the default drop-per-test reset, and build any fixture tables inside individual tests.keepsMigratedSchema() snapshots only the migrated schema. Tables you create by hand in a test are not preserved and are dropped before the next test.migrationSources() to return an array of paths. An empty array is valid and, since 1.6.1, safe to use with keepsMigratedSchema().keepsMigratedSchema() with an empty migrationSources() caused every database test to fail with no such table: migrations. Upgrade to 1.6.1+ if you have such test cases.keepsMigratedSchema() only keeps a schema snapshot when a migrations table exists after migrating. With no migrations, it keeps nothing and the test case stays on the drop-per-test reset.keepsMigratedSchema() is called, because they are not part of the schema snapshot.no such table: migrations, check whether a test case calls keepsMigratedSchema() without any migration sources. Either remove the call or add sources.migrationSources() to control migration discovery; return an empty array when your package has no migrations.How can I help you explore Laravel packages today?