4
4
5
5
namespace MongoDB \Laravel \Tests ;
6
6
7
+ use Illuminate \Database \Eloquent \Model ;
7
8
use Illuminate \Foundation \Application ;
9
+ use Laravel \Scout \ScoutServiceProvider ;
8
10
use MongoDB \Laravel \MongoDBServiceProvider ;
9
- use MongoDB \Laravel \Scout \ScoutServiceProvider ;
11
+ use MongoDB \Laravel \Scout \MongoDBScoutServiceProvider ;
10
12
use MongoDB \Laravel \Tests \Models \User ;
11
13
use MongoDB \Laravel \Validation \ValidationServiceProvider ;
12
14
use Orchestra \Testbench \TestCase as OrchestraTestCase ;
13
15
14
16
class TestCase extends OrchestraTestCase
15
17
{
16
- /** @var class-string */
17
- protected static string $ userModel = User::class;
18
-
19
18
/**
20
19
* Get package providers.
21
20
*
@@ -26,8 +25,8 @@ protected function getPackageProviders($app): array
26
25
return [
27
26
MongoDBServiceProvider::class,
28
27
ValidationServiceProvider::class,
29
- \Laravel \Scout \ScoutServiceProvider::class,
30
28
ScoutServiceProvider::class,
29
+ MongoDBScoutServiceProvider::class,
31
30
];
32
31
}
33
32
@@ -51,7 +50,7 @@ protected function getEnvironmentSetUp($app): void
51
50
$ app ['config ' ]->set ('database.connections.mongodb2 ' , $ config ['connections ' ]['mongodb ' ]);
52
51
53
52
$ app ['config ' ]->set ('auth.model ' , User::class);
54
- $ app ['config ' ]->set ('auth.providers.users.model ' , self :: $ userModel );
53
+ $ app ['config ' ]->set ('auth.providers.users.model ' , static :: getUserModel () );
55
54
$ app ['config ' ]->set ('cache.driver ' , 'array ' );
56
55
57
56
$ app ['config ' ]->set ('cache.stores.mongodb ' , [
@@ -73,4 +72,10 @@ protected function getEnvironmentSetUp($app): void
73
72
$ app ['config ' ]->set ('scout.driver ' , 'mongodb ' );
74
73
$ app ['config ' ]->set ('scout.prefix ' , 'scout_ ' );
75
74
}
75
+
76
+ /** @return class-string<Model> */
77
+ protected static function getUserModel (): string
78
+ {
79
+ return User::class;
80
+ }
76
81
}
0 commit comments