eZ\Publish\Core\Persistence\Legacy\Tests\Content\ObjectState\ObjectStateHandlerTest::testDeleteGroup PHP Method

testDeleteGroup() public method

public testDeleteGroup ( )
    public function testDeleteGroup()
    {
        $handler = $this->getObjectStateHandler();
        $mapperMock = $this->getMapperMock();
        $gatewayMock = $this->getGatewayMock();
        $gatewayMock->expects($this->once())->method('loadObjectStateListData')->with($this->equalTo(2))->will($this->returnValue(array(array())));
        $mapperMock->expects($this->once())->method('createObjectStateListFromData')->with($this->equalTo(array(array())))->will($this->returnValue(array(new ObjectState(array('id' => 1)), new ObjectState(array('id' => 2)))));
        $gatewayMock->expects($this->exactly(2))->method('deleteObjectStateLinks');
        $gatewayMock->expects($this->exactly(2))->method('deleteObjectState');
        $gatewayMock->expects($this->at(1))->method('deleteObjectStateLinks')->with($this->equalTo(1));
        $gatewayMock->expects($this->at(2))->method('deleteObjectState')->with($this->equalTo(1));
        $gatewayMock->expects($this->at(3))->method('deleteObjectStateLinks')->with($this->equalTo(2));
        $gatewayMock->expects($this->at(4))->method('deleteObjectState')->with($this->equalTo(2));
        $gatewayMock->expects($this->once())->method('deleteObjectStateGroup')->with($this->equalTo(2));
        $handler->deleteGroup(2);
    }