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

testAssignRole() public method

public testAssignRole ( )
    public function testAssignRole()
    {
        $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('assignRole')->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->assignRole(33, 22);
    }