public function testEntityConfigId() { $entityId = new EntityConfigId('testScope', 'Test\\Class'); $this->assertEquals('Test\\Class', $entityId->getClassName()); $this->assertEquals('testScope', $entityId->getScope()); $this->assertEquals('entity_testScope_Test-Class', $entityId->toString()); }
public function testGetEntityConfigNotCachedScope() { $configId = new EntityConfigId(self::SCOPE, self::ENTITY_CLASS); $anotherConfigId = new EntityConfigId('another', self::ENTITY_CLASS); $anotherConfigValues = ['key2' => 'val2']; $anotherConfig = new Config($anotherConfigId, $anotherConfigValues); $cacheKey = self::ENTITY_CLASS; $this->cache->expects($this->once())->method('fetch')->with($cacheKey)->willReturn(['another' => $anotherConfigValues]); $this->assertNull($this->configCache->getEntityConfig($configId->getScope(), $configId->getClassName())); // test local cache $this->assertNull($this->configCache->getEntityConfig($configId->getScope(), $configId->getClassName())); $this->assertEquals($anotherConfig, $this->configCache->getEntityConfig($anotherConfigId->getScope(), $anotherConfigId->getClassName())); }
public function testGetConfig() { $this->assertEquals('Test\\Class', $this->entityId->getClassName()); $this->assertEquals('testScope', $this->entityId->getScope()); $this->assertEquals('entity_testScope_Test-Class', $this->entityId->toString()); }