public function testRead() { $configFiles = [file_get_contents(realpath(__DIR__ . '/_files/integrationA.xml')), file_get_contents(realpath(__DIR__ . '/_files/integrationB.xml'))]; $this->fileResolverMock->expects($this->any())->method('get')->will($this->returnValue($configFiles)); $expectedResult = (require __DIR__ . '/_files/integration.php'); $this->assertEquals($expectedResult, $this->configReader->read(), 'Error happened during config reading.'); }
/** * Return integrations loaded from cache if enabled or from files merged previously * * @return array */ public function getIntegrations() { if (null === $this->integrations) { $integrations = $this->configCacheType->load(self::CACHE_ID); if ($integrations && is_string($integrations)) { $this->integrations = unserialize($integrations); } else { $this->integrations = $this->configReader->read(); $this->configCacheType->save(serialize($this->integrations), self::CACHE_ID, [TypeConsolidated::CACHE_TAG]); } } return $this->integrations; }