public function testRead()
 {
     $configFiles = [file_get_contents(realpath(__DIR__ . '/_files/configA.xml')), file_get_contents(realpath(__DIR__ . '/_files/configB.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.');
 }
Beispiel #2
0
 /**
  * Return integrations loaded from cache if enabled or from files merged previously
  *
  * @return array
  * @api
  */
 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, [Type::CACHE_TAG]);
         }
     }
     return $this->_integrations;
 }