Exemplo n.º 1
0
 public function testGetModuleWhenDataIsNotCached()
 {
     $moduleData = array('name' => 'declared_module', 'version' => '1.0.0.0', 'active' => false);
     $data = array('declared_module' => $moduleData);
     $cacheId = 'global::modules_declaration_cache';
     $this->cacheMock->expects($this->once())->method('load')->with($cacheId);
     $this->readerMock->expects($this->once())->method('read')->with('global')->will($this->returnValue($data));
     $this->cacheMock->expects($this->once())->method('save')->with(serialize($data), $cacheId);
     $model = new ModuleList($this->readerMock, $this->cacheMock);
     $this->assertEquals($moduleData, $model->getModule('declared_module'));
     $this->assertNull($model->getModule('not_declared_module'));
 }