public function testDebugCached() {
$timestamp = 123;
$expected = array(
'foo' => array(
array(),
array(),
array(),
),
'bar' => array(
array(),
array(),
array(),
),
);
$this->configCache
->expects($this
->once())
->method('has')
->with($this
->isType('string'))
->will($this
->returnValue(true));
$this->configCache
->expects($this
->once())
->method('getTimestamp')
->with($this
->isType('string'))
->will($this
->returnValue($timestamp));
$this->resource
->expects($this
->once())
->method('isFresh')
->with($timestamp)
->will($this
->returnValue(true));
$this->loader
->expects($this
->never())
->method('load');
$this->configCache
->expects($this
->once())
->method('get')
->with($this
->isType('string'))
->will($this
->returnValue($expected));
$loader = new CachedFormulaLoader($this->loader, $this->configCache, true);
$this
->assertEquals($expected, $loader
->load($this->resource), '->load() returns formulae');
}