public function testLoadWithoutCachedData()
 {
     $this->cacheConfig->expects($this->exactly(2))->method('getCacheManager')->willReturn($this->cache);
     $this->cacheConfig->expects($this->exactly(2))->method('getKey')->willReturn(new Key('potato'));
     $this->cacheConfig->expects($this->once())->method('getTtl')->willReturn(5001);
     $this->trainCacherMockWithLoadReturnValue(null);
     $this->reader->expects($this->once())->method('read')->will($this->returnValue($this->config));
     $this->cache->expects($this->once())->method('get')->will($this->returnValue($this->config));
     $this->reader->method('getConfig')->will($this->returnValue($this->config));
     $this->assertSame($this->config, $this->loader->load());
 }
Exemplo n.º 2
0
 /**
  * Reads a configuration and returns it.
  */
 private function read()
 {
     $this->reader->read($this->name);
     return $this->reader->getConfig();
 }