public function testGetModulesWhenDataIsCached() { $data = array('declared_module' => array('name' => 'declared_module', 'version' => '1.0.0.0', 'active' => false)); $cacheId = 'global::modules_declaration_cache'; $this->cacheMock->expects($this->once())->method('load')->with($cacheId)->will($this->returnValue(serialize($data))); $this->readerMock->expects($this->never())->method('read'); $this->cacheMock->expects($this->never())->method('save'); $model = new ModuleList($this->readerMock, $this->cacheMock); $this->assertEquals($data, $model->getModules()); }