eZ\Publish\Core\Persistence\Legacy\Tests\Content\Type\ContentUpdater\Action\AddFieldTest::testApplySingleVersionMultipleTranslations PHP Method

testApplySingleVersionMultipleTranslations() public method

    public function testApplySingleVersionMultipleTranslations()
    {
        $contentId = 42;
        $versionNumbers = array(1);
        $content = $this->getContentFixture(1, array('eng-GB', 'ger-DE'));
        $action = $this->getMockedAction(array('insertField'));
        $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)));
        $action->expects($this->at(0))->method('insertField')->with($content, $this->getFieldReference(null, 1, 'eng-GB'))->will($this->returnValue('fieldId1'));
        $action->expects($this->at(1))->method('insertField')->with($content, $this->getFieldReference(null, 1, 'ger-DE'))->will($this->returnValue('fieldId2'));
        $action->apply($contentId);
    }