示例#1
0
 public function testRead()
 {
     $configFiles = [file_get_contents(realpath(__DIR__ . '/_files/apiA.xml')), file_get_contents(realpath(__DIR__ . '/_files/apiB.xml'))];
     $this->_fileResolverMock->expects($this->any())->method('get')->will($this->returnValue($configFiles));
     $expectedResult = (require __DIR__ . '/_files/api.php');
     $this->assertEquals($expectedResult, $this->_configReader->read(), 'Error happened during config reading.');
 }
示例#2
0
 /**
  * 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, array(TypeIntegration::CACHE_TAG));
         }
     }
     return $this->_integrations;
 }