eZ\Publish\Core\Persistence\Legacy\Tests\Content\Type\ContentUpdater\Action\RemoveFieldTest::testApplySingleVersionSingleTranslation PHP Method

testApplySingleVersionSingleTranslation() public method

    public function testApplySingleVersionSingleTranslation()
    {
        $contentId = 42;
        $versionNumbers = array(1);
        $action = $this->getRemoveFieldAction();
        $content = $this->getContentFixture(1, array('cro-HR'));
        $this->getContentGatewayMock()->expects($this->once())->method('listVersionNumbers')->with($this->equalTo($contentId))->will($this->returnValue($versionNumbers));
        $this->getContentGatewayMock()->expects($this->once())->method('loadVersionedNameData')->with($this->equalTo(array(array('id' => $contentId, 'version' => 1))))->will($this->returnValue(array()));
        $this->getContentGatewayMock()->expects($this->at(2))->method('load')->with($contentId, 1)->will($this->returnValue(array()));
        $this->getContentMapperMock()->expects($this->once())->method('extractContentFromRows')->with(array(), array())->will($this->returnValue(array($content)));
        $this->getContentGatewayMock()->expects($this->once())->method('deleteField')->with($this->equalTo('3-cro-HR'));
        $this->getContentStorageHandlerMock()->expects($this->once())->method('deleteFieldData')->with($this->equalTo('ezstring'), $content->versionInfo, $this->equalTo(array('3-cro-HR')));
        $action->apply($contentId);
    }