eZ\Publish\Core\Persistence\Cache\Tests\LocationHandlerTest::testLoadLocationsByContentIsMiss PHP Method

testLoadLocationsByContentIsMiss() public method

    public function testLoadLocationsByContentIsMiss()
    {
        $this->loggerMock->expects($this->once())->method('logCall');
        $cacheItemMock = $this->getMock('Stash\\Interfaces\\ItemInterface');
        $this->cacheMock->expects($this->once())->method('getItem')->with('content', 'locations', 44)->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('loadLocationsByContent')->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->loadLocationsByContent(44);
    }