public function KeyValueFactoryTest::testGetExpirable in MongoDB 8.2
Test the collections provided by the expirable Key-Value factory.
Throws
\Exception
File
- modules/
mongodb_storage/ tests/ src/ Kernel/ KeyValueFactoryTest.php, line 27
Class
- KeyValueFactoryTest
- Tests the KeyValueFactory.
Namespace
Drupal\Tests\mongodb_storage\KernelCode
public function testGetExpirable() {
/** @var \Drupal\Core\KeyValueStore\KeyValueExpirableFactoryInterface $factory */
$factory = $this->container
->get(Storage::SERVICE_KVE);
$store = $factory
->get(static::COLLECTION);
$this
->assertInstanceOf(KeyValueStoreExpirable::class, $store, "Store is not an expirable key-value");
$actual = $store
->getCollectionName();
$this
->assertEquals(static::COLLECTION, $actual, 'Collection name matches');
}