public testLoadParentLocationsForDraftContentIsMiss ( ) |
public function testLoadParentLocationsForDraftContentIsMiss()
{
$this->loggerMock->expects($this->once())->method('logCall');
$cacheItemMock = $this->getMock('Stash\\Interfaces\\ItemInterface');
$this->cacheMock->expects($this->once())->method('getItem')->with('content', 'locations', '44', 'parentLocationsForDraftContent')->will($this->returnValue($cacheItemMock));
$cacheItemMock->expects($this->once())->method('get')->will($this->returnValue(null));
$cacheItemMock->expects($this->once())->method('isMiss')->will($this->returnValue(true));
$innerHandlerMock = $this->getMock('eZ\\Publish\\SPI\\Persistence\\Content\\Location\\Handler');
$this->persistenceHandlerMock->expects($this->once())->method('locationHandler')->will($this->returnValue($innerHandlerMock));
$innerHandlerMock->expects($this->once())->method('loadParentLocationsForDraftContent')->with(44)->will($this->returnValue(array(new Location(array('id' => 33)))));
$cacheItemMock->expects($this->once())->method('set')->with(array(33))->will($this->returnValue($cacheItemMock));
$cacheItemMock->expects($this->once())->method('save')->with();
$handler = $this->persistenceCacheHandler->locationHandler();
$handler->loadParentLocationsForDraftContent(44);
}