eZ\Publish\Core\Persistence\Legacy\Tests\Content\Type\ContentTypeHandlerTest::testCreateVersion PHP Method

testCreateVersion() public method

public testCreateVersion ( )
    public function testCreateVersion()
    {
        $gatewayMock = $this->getGatewayMock();
        $mapperMock = $this->getMapperMock();
        $mapperMock->expects($this->once())->method('createCreateStructFromType')->with($this->isInstanceOf('eZ\\Publish\\SPI\\Persistence\\Content\\Type'))->will($this->returnValue(new CreateStruct()));
        $handlerMock = $this->getMock('eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Type\\Handler', array('load', 'internalCreate'), array($gatewayMock, $mapperMock, $this->getUpdateHandlerMock()));
        $handlerMock->expects($this->once())->method('load')->with($this->equalTo(23, 0))->will($this->returnValue(new Type()));
        $handlerMock->expects($this->once())->method('internalCreate')->with($this->logicalAnd($this->attributeEqualTo('status', 1), $this->attributeEqualTo('modifierId', 42), $this->attribute($this->greaterThanOrEqual(time()), 'modified')))->will($this->returnValue(new Type()));
        $res = $handlerMock->createDraft(42, 23);
        $this->assertInstanceOf('eZ\\Publish\\SPI\\Persistence\\Content\\Type', $res);
    }