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

testCreateRole() public method

public testCreateRole ( )
    public function testCreateRole()
    {
        $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('createRole')->with($this->isInstanceOf('eZ\\Publish\\SPI\\Persistence\\User\\RoleCreateStruct'))->will($this->returnValue(new Role(['id' => 33, 'name' => 'Editors', 'identifier' => 'intranet', 'status' => Role::STATUS_DEFINED])));
        $cacheItemMock = $this->getMock('Stash\\Interfaces\\ItemInterface');
        $this->cacheMock->expects($this->never())->method('getItem');
        $cacheItemMock->expects($this->never())->method('set');
        $cacheItemMock->expects($this->never())->method('get');
        $handler = $this->persistenceCacheHandler->userHandler();
        $handler->createRole(new User\RoleCreateStruct());
    }