1010use Laravel \Telescope \Storage \EntryModel ;
1111use Laravel \Telescope \Telescope ;
1212use Laravel \Telescope \TelescopeServiceProvider ;
13- use Orchestra \Testbench \Concerns \WithLaravelMigrations ;
13+ use Orchestra \Testbench \Attributes \WithConfig ;
14+ use Orchestra \Testbench \Attributes \WithMigration ;
1415use Orchestra \Testbench \Concerns \WithWorkbench ;
1516use Orchestra \Testbench \TestCase ;
1617
18+ #[WithMigration]
19+ #[WithConfig('logging.default ' , 'errorlog ' )]
1720class FeatureTestCase extends TestCase
1821{
19- use WithWorkbench, RefreshDatabase, WithLaravelMigrations ;
22+ use WithWorkbench, RefreshDatabase;
2023
24+ /** {@inheritdoc} */
25+ #[\Override]
2126 protected function setUp (): void
2227 {
2328 parent ::setUp ();
@@ -28,6 +33,8 @@ protected function setUp(): void
2833 Telescope::$ afterStoringHooks = [];
2934 }
3035
36+ /** {@inheritdoc} */
37+ #[\Override]
3138 protected function tearDown (): void
3239 {
3340 Telescope::flushEntries ();
@@ -38,18 +45,24 @@ protected function tearDown(): void
3845 parent ::tearDown ();
3946 }
4047
48+ /** {@inheritdoc} */
49+ #[\Override]
4150 protected function getPackageProviders ($ app )
4251 {
4352 return [
4453 TelescopeServiceProvider::class,
4554 ];
4655 }
4756
57+ /** {@inheritdoc} */
58+ #[\Override]
4859 public function ignorePackageDiscoveriesFrom ()
4960 {
5061 return ['* ' , 'spatie/laravel-ray ' ];
5162 }
5263
64+ /** {@inheritdoc} */
65+ #[\Override]
5366 protected function resolveApplicationCore ($ app )
5467 {
5568 parent ::resolveApplicationCore ($ app );
@@ -59,26 +72,19 @@ protected function resolveApplicationCore($app)
5972 });
6073 }
6174
62- /**
63- * @param \Illuminate\Foundation\Application $app
64- * @return void
65- */
66- protected function getEnvironmentSetUp ($ app )
75+ /** {@inheritdoc} */
76+ #[\Override]
77+ protected function defineEnvironment ($ app )
6778 {
68- $ config = $ app ->get ('config ' );
69-
70- $ config ->set ('logging.default ' , 'errorlog ' );
71-
72- $ config ->set ('database.default ' , 'testbench ' );
73-
74- $ config ->set ('telescope.storage.database.connection ' , 'testbench ' );
75-
76- $ config ->set ('queue.batching.database ' , 'testbench ' );
77-
78- $ config ->set ('database.connections.testbench ' , [
79- 'driver ' => 'sqlite ' ,
80- 'database ' => ':memory: ' ,
81- 'prefix ' => '' ,
79+ $ app ->make ('config ' )->set ([
80+ 'database.default ' => 'testbench ' ,
81+ 'telescope.storage.database.connection ' => 'testbench ' ,
82+ 'queue.batching.database ' => 'testbench ' ,
83+ 'database.connections.testbench ' => [
84+ 'driver ' => 'sqlite ' ,
85+ 'database ' => ':memory: ' ,
86+ 'prefix ' => '' ,
87+ ],
8288 ]);
8389
8490 $ app ->when (DatabaseEntriesRepository::class)
0 commit comments