44
55namespace Tests \Tempest \Integration \Core ;
66
7+ use Tests \Tempest \Fixtures \GlobalHiddenPathDiscovery ;
78use PHPUnit \Framework \Attributes \Test ;
89use Tempest \Database \DatabaseMigration ;
9- use Tempest \Database \MigrationDiscovery ;
1010use Tempest \Database \Migrations \RunnableMigrations ;
11- use Tempest \Discovery \DiscoveryLocation ;
1211use Tests \Tempest \Fixtures \Discovery \HiddenDatabaseMigration ;
1312use Tests \Tempest \Fixtures \Discovery \HiddenMigratableDatabaseMigration ;
13+ use Tests \Tempest \Fixtures \GlobalHiddenDiscovery ;
1414use Tests \Tempest \Integration \FrameworkIntegrationTestCase ;
1515
1616use function Tempest \get ;
@@ -23,37 +23,26 @@ final class LoadDiscoveryClassesTest extends FrameworkIntegrationTestCase
2323 #[Test]
2424 public function do_not_discover (): void
2525 {
26- $ this ->kernel ->discoveryClasses = [
27- MigrationDiscovery::class,
28- ];
29-
30- $ this ->kernel ->discoveryLocations = [
31- new DiscoveryLocation (
32- 'Tests\Tempest\Fixtures ' ,
33- __DIR__ . '../../Fixtures/Discovery ' ,
34- ),
35- ];
36-
3726 $ migrations = get (RunnableMigrations::class);
3827
3928 $ this ->assertNotContains (HiddenDatabaseMigration::class, $ migrations );
4029 }
4130
4231 #[Test]
43- public function do_not_discover_except (): void
32+ public function do_not_discover_global_class (): void
4433 {
45- $ this ->kernel ->discoveryClasses = [
46- MigrationDiscovery::class,
47- // TODO: update tests to add `PublishDiscovery` when it's merged
48- ];
34+ $ this ->assertFalse (GlobalHiddenDiscovery::$ discovered );
35+ }
4936
50- $ this ->kernel ->discoveryLocations = [
51- new DiscoveryLocation (
52- 'Tests\Tempest\Fixtures ' ,
53- __DIR__ . '../../Fixtures/Discovery ' ,
54- ),
55- ];
37+ #[Test]
38+ public function do_not_discover_global_path (): void
39+ {
40+ $ this ->assertFalse (GlobalHiddenPathDiscovery::$ discovered );
41+ }
5642
43+ #[Test]
44+ public function do_not_discover_except (): void
45+ {
5746 $ migrations = get (RunnableMigrations::class);
5847
5948 $ foundMigrations = array_filter (
0 commit comments