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

testUpdate() public method

public testUpdate ( )
    public function testUpdate()
    {
        $handler = $this->getObjectStateHandler();
        $mapperMock = $this->getMapperMock();
        $gatewayMock = $this->getGatewayMock();
        $mapperMock->expects($this->once())->method('createObjectStateFromInputStruct')->with($this->equalTo($this->getInputStructFixture()))->will($this->returnValue($this->getObjectStateFixture()));
        $gatewayMock->expects($this->once())->method('updateObjectState')->with($this->equalTo(new ObjectState(array('id' => 1))));
        $gatewayMock->expects($this->once())->method('loadObjectStateData')->with($this->equalTo(1))->will($this->returnValue(array(array())));
        $mapperMock->expects($this->once())->method('createObjectStateFromData')->with($this->equalTo(array(array())))->will($this->returnValue($this->getObjectStateFixture()));
        $result = $handler->update(1, $this->getInputStructFixture());
        $this->assertInstanceOf('eZ\\Publish\\SPI\\Persistence\\Content\\ObjectState', $result);
    }