Example #1
0
 public function testLoadCache()
 {
     $this->config->setCacheChecksum(false);
     $this->assertFalse($this->config->loadCache());
     $this->config->setCacheId('cacheId');
     $this->config->setCacheChecksum('CacheChecksum');
     $cache = $this->getMock('Magento\\Framework\\Simplexml\\Config\\Cache\\File', ['load']);
     $this->config->setCache($cache);
     $cache->expects($this->at(0))->method('load')->with('cacheId__CHECKSUM')->will($this->returnValue('415a5472d4f94b71ff80fd1c8e9eca7f'));
     $cache->expects($this->at(1))->method('load')->with('cacheId')->will($this->returnValue(''));
     $this->config->setCache($cache);
     $cache->expects($this->at(2))->method('load')->with('cacheId__CHECKSUM')->will($this->returnValue('415a5472d4f94b71ff80fd1c8e9eca7f'));
     $cache->expects($this->at(3))->method('load')->with('cacheId')->will($this->returnValue('<?xml version="1.0"?><config><node>1</node></config>'));
     $this->assertFalse($this->config->loadCache());
     $this->assertTrue($this->config->loadCache());
 }