eZ\Publish\Core\Repository\Tests\Service\Mock\RelationProcessorTest::testProcessFieldRelationsNoChanges PHP Method

testProcessFieldRelationsNoChanges() public method

Test for the processFieldRelations() method.
    public function testProcessFieldRelationsNoChanges()
    {
        $relationProcessor = $this->getPartlyMockedRelationProcessor();
        $contentHandlerMock = $this->getPersistenceMockHandler('Content\\Handler');
        $contentTypeMock = $this->getMockForAbstractClass('eZ\\Publish\\API\\Repository\\Values\\ContentType\\ContentType');
        $contentTypeMock->expects($this->once())->method('getFieldDefinition')->with($this->equalTo('identifier42'))->will($this->returnValue(new FieldDefinition(array('id' => 42))));
        $contentHandlerMock->expects($this->never())->method('addRelation');
        $contentHandlerMock->expects($this->never())->method('removeRelation');
        $existingRelations = array($this->getStubbedRelation(1, Relation::COMMON, null, 10), $this->getStubbedRelation(2, Relation::EMBED, null, 11), $this->getStubbedRelation(3, Relation::LINK, null, 12), $this->getStubbedRelation(4, Relation::FIELD, 42, 13), $this->getStubbedRelation(5, Relation::EMBED | Relation::COMMON, null, 14), $this->getStubbedRelation(6, Relation::LINK | Relation::COMMON, null, 15), $this->getStubbedRelation(7, Relation::EMBED | Relation::LINK, null, 16), $this->getStubbedRelation(8, Relation::EMBED | Relation::LINK | Relation::COMMON, null, 17));
        $inputRelations = array(Relation::EMBED => array_flip(array(11, 14, 16, 17)), Relation::LINK => array_flip(array(12, 15, 16, 17)), Relation::FIELD => array(42 => array_flip(array(13))));
        $relationProcessor->processFieldRelations($inputRelations, 24, 2, $contentTypeMock, $existingRelations);
    }