Skip to content

Commit 451548b

Browse files
committed
Rename the ScoutServiceProvider
1 parent d3f60e4 commit 451548b

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"providers": [
7373
"MongoDB\\Laravel\\MongoDBServiceProvider",
7474
"MongoDB\\Laravel\\MongoDBBusServiceProvider",
75-
"MongoDB\\Laravel\\Scout\\ScoutServiceProvider"
75+
"MongoDB\\Laravel\\Scout\\MongoDBScoutServiceProvider"
7676
]
7777
}
7878
},

src/Scout/ScoutServiceProvider.php renamed to src/Scout/MongoDBScoutServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use function assert;
1212
use function sprintf;
1313

14-
class ScoutServiceProvider extends ServiceProvider
14+
class MongoDBScoutServiceProvider extends ServiceProvider
1515
{
1616
public function register(): void
1717
{

tests/TestCase.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@
44

55
namespace MongoDB\Laravel\Tests;
66

7+
use Illuminate\Database\Eloquent\Model;
78
use Illuminate\Foundation\Application;
89
use MongoDB\Driver\Exception\ServerException;
910
use MongoDB\Laravel\MongoDBServiceProvider;
1011
use MongoDB\Laravel\Schema\Builder;
12+
use MongoDB\Laravel\Scout\MongoDBScoutServiceProvider;
1113
use MongoDB\Laravel\Scout\ScoutServiceProvider;
1214
use MongoDB\Laravel\Tests\Models\User;
1315
use MongoDB\Laravel\Validation\ValidationServiceProvider;
1416
use Orchestra\Testbench\TestCase as OrchestraTestCase;
1517

1618
class TestCase extends OrchestraTestCase
1719
{
18-
/** @var class-string */
19-
protected static string $userModel = User::class;
20-
2120
/**
2221
* Get package providers.
2322
*
@@ -28,8 +27,8 @@ protected function getPackageProviders($app): array
2827
return [
2928
MongoDBServiceProvider::class,
3029
ValidationServiceProvider::class,
31-
\Laravel\Scout\ScoutServiceProvider::class,
3230
ScoutServiceProvider::class,
31+
MongoDBScoutServiceProvider::class,
3332
];
3433
}
3534

@@ -53,7 +52,7 @@ protected function getEnvironmentSetUp($app): void
5352
$app['config']->set('database.connections.mongodb2', $config['connections']['mongodb']);
5453

5554
$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());
5756
$app['config']->set('cache.driver', 'array');
5857

5958
$app['config']->set('cache.stores.mongodb', [
@@ -88,4 +87,10 @@ public function skipIfSearchIndexManagementIsNotSupported(): void
8887
throw $e;
8988
}
9089
}
90+
91+
/** @return class-string<Model> */
92+
protected static function getUserModel(): string
93+
{
94+
return User::class;
95+
}
9196
}

0 commit comments

Comments
 (0)