4
4
5
5
namespace MongoDB \Laravel \Tests ;
6
6
7
+ use Illuminate \Database \Eloquent \Model ;
7
8
use Illuminate \Foundation \Application ;
8
9
use MongoDB \Driver \Exception \ServerException ;
9
10
use MongoDB \Laravel \MongoDBServiceProvider ;
10
11
use MongoDB \Laravel \Schema \Builder ;
12
+ use MongoDB \Laravel \Scout \MongoDBScoutServiceProvider ;
11
13
use MongoDB \Laravel \Scout \ScoutServiceProvider ;
12
14
use MongoDB \Laravel \Tests \Models \User ;
13
15
use MongoDB \Laravel \Validation \ValidationServiceProvider ;
14
16
use Orchestra \Testbench \TestCase as OrchestraTestCase ;
15
17
16
18
class TestCase extends OrchestraTestCase
17
19
{
18
- /** @var class-string */
19
- protected static string $ userModel = User::class;
20
-
21
20
/**
22
21
* Get package providers.
23
22
*
@@ -28,8 +27,8 @@ protected function getPackageProviders($app): array
28
27
return [
29
28
MongoDBServiceProvider::class,
30
29
ValidationServiceProvider::class,
31
- \Laravel \Scout \ScoutServiceProvider::class,
32
30
ScoutServiceProvider::class,
31
+ MongoDBScoutServiceProvider::class,
33
32
];
34
33
}
35
34
@@ -53,7 +52,7 @@ protected function getEnvironmentSetUp($app): void
53
52
$ app ['config ' ]->set ('database.connections.mongodb2 ' , $ config ['connections ' ]['mongodb ' ]);
54
53
55
54
$ app ['config ' ]->set ('auth.model ' , User::class);
56
- $ app ['config ' ]->set ('auth.providers.users.model ' , self :: $ userModel );
55
+ $ app ['config ' ]->set ('auth.providers.users.model ' , static :: getUserModel () );
57
56
$ app ['config ' ]->set ('cache.driver ' , 'array ' );
58
57
59
58
$ app ['config ' ]->set ('cache.stores.mongodb ' , [
@@ -88,4 +87,10 @@ public function skipIfSearchIndexManagementIsNotSupported(): void
88
87
throw $ e ;
89
88
}
90
89
}
90
+
91
+ /** @return class-string<Model> */
92
+ protected static function getUserModel (): string
93
+ {
94
+ return User::class;
95
+ }
91
96
}
0 commit comments