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

testUpdate() public method

public testUpdate ( )
    public function testUpdate()
    {
        $this->loggerMock->expects($this->once())->method('logCall');
        $cacheItemMock = $this->getMock('Stash\\Interfaces\\ItemInterface');
        $this->cacheMock->expects($this->at(0))->method('clear')->with('location', 33);
        $this->cacheMock->expects($this->at(1))->method('clear')->with('location', 'subtree');
        $innerHandler = $this->getMock('eZ\\Publish\\SPI\\Persistence\\Content\\Location\\Handler');
        $this->persistenceHandlerMock->expects($this->once())->method('locationHandler')->will($this->returnValue($innerHandler));
        $innerHandler->expects($this->once())->method('update')->with($this->isInstanceOf('eZ\\Publish\\SPI\\Persistence\\Content\\Location\\UpdateStruct'), 33)->will($this->returnValue(new Location(array('id' => 33))));
        $cacheItemMock->expects($this->never())->method('get');
        $handler = $this->persistenceCacheHandler->locationHandler();
        $handler->update(new UpdateStruct(), 33);
    }