diff --git a/Tests/Store/MongoDbStoreFactoryTest.php b/Tests/Store/MongoDbStoreFactoryTest.php index 8256381..7782f97 100644 --- a/Tests/Store/MongoDbStoreFactoryTest.php +++ b/Tests/Store/MongoDbStoreFactoryTest.php @@ -11,6 +11,9 @@ namespace Symfony\Component\Lock\Tests\Store; +use MongoDB\Collection; +use MongoDB\Client; +use PHPUnit\Framework\SkippedTestSuiteError; use PHPUnit\Framework\TestCase; use Symfony\Component\Lock\Store\MongoDbStore; use Symfony\Component\Lock\Store\StoreFactory; @@ -18,13 +21,20 @@ /** * @author Alexandre Daubois * - * @requires extension mongo + * @requires extension mongodb */ class MongoDbStoreFactoryTest extends TestCase { + public static function setupBeforeClass(): void + { + if (!class_exists(Client::class)) { + throw new SkippedTestSuiteError('The mongodb/mongodb package is required.'); + } + } + public function testCreateMongoDbCollectionStore() { - $store = StoreFactory::createStore($this->createMock(\MongoDB\Collection::class)); + $store = StoreFactory::createStore($this->createMock(Collection::class)); $this->assertInstanceOf(MongoDbStore::class, $store); } diff --git a/Tests/Store/MongoDbStoreTest.php b/Tests/Store/MongoDbStoreTest.php index a5c0233..7efa540 100644 --- a/Tests/Store/MongoDbStoreTest.php +++ b/Tests/Store/MongoDbStoreTest.php @@ -32,7 +32,7 @@ class MongoDbStoreTest extends AbstractStoreTestCase public static function setupBeforeClass(): void { - if (!class_exists(\MongoDB\Client::class)) { + if (!class_exists(Client::class)) { throw new SkippedTestSuiteError('The mongodb/mongodb package is required.'); }