eZ\Publish\Core\Persistence\Cache\Tests\UserHandlerTest::testUnassignRole PHP Method

testUnassignRole() public method

public testUnassignRole ( )
    public function testUnassignRole()
    {
        $this->loggerMock->expects($this->once())->method('logCall');
        $innerHandlerMock = $this->getMock('eZ\\Publish\\SPI\\Persistence\\User\\Handler');
        $this->persistenceHandlerMock->expects($this->once())->method('userHandler')->will($this->returnValue($innerHandlerMock));
        $innerHandlerMock->expects($this->once())->method('unassignRole')->with(33, 22)->will($this->returnValue(true));
        $this->cacheMock->expects($this->at(0))->method('clear')->with('user', 'role', 22)->will($this->returnValue(true));
        $this->cacheMock->expects($this->at(1))->method('clear')->with('user', 'role', 'assignments', 'byGroup', 33)->will($this->returnValue(true));
        $this->cacheMock->expects($this->at(2))->method('clear')->with('user', 'role', 'assignments', 'byGroup', 'inherited')->will($this->returnValue(true));
        $handler = $this->persistenceCacheHandler->userHandler();
        $handler->unassignRole(33, 22);
    }