eZ\Publish\Core\Persistence\Cache\Tests\ObjectStateHandlerTest::testUpdateGroup PHP Method

testUpdateGroup() public method

public testUpdateGroup ( )
    public function testUpdateGroup()
    {
        $inputStruct = new SPIInputStruct(array('identifier' => 'test_state_group', 'name' => 'Test State Group (New)'));
        $expectedGroup = new SPIObjectStateGroup(array('id' => 1, 'identifier' => 'test_state_group_new', 'name' => 'Test State Group (New)'));
        $this->loggerMock->expects($this->once())->method('logCall');
        $innerHandlerMock = $this->getMock('eZ\\Publish\\SPI\\Persistence\\Content\\ObjectState\\Handler');
        $this->persistenceHandlerMock->expects($this->once())->method('objectStateHandler')->will($this->returnValue($innerHandlerMock));
        $innerHandlerMock->expects($this->once())->method('updateGroup')->with(1, $inputStruct)->will($this->returnValue($expectedGroup));
        $cacheItemMock = $this->getMock('Stash\\Interfaces\\ItemInterface');
        $this->cacheMock->expects($this->at(0))->method('clear')->with('objectstategroup', 1);
        $handler = $this->persistenceCacheHandler->objectStateHandler();
        $newGroup = $handler->updateGroup(1, $inputStruct);
        $this->assertEquals($newGroup, $expectedGroup);
    }