public function testNotTaggable() { $this->helper->expects($this->once())->method('isTaggable')->willReturn(false); $this->entityMetadata = $this->getMockBuilder('Oro\\Bundle\\EntityMergeBundle\\Metadata\\EntityMetadata')->setMethods(['getClassName', 'addFieldMetadata'])->disableOriginalConstructor()->getMock(); $this->entityMetadata->expects($this->any())->method('getClassName')->will($this->returnValue(get_class($this->createNotTaggableEntity()))); $this->entityMetadata->expects($this->never())->method('addFieldMetadata'); $event = new EntityMetadataEvent($this->entityMetadata); $this->listener->onBuildMetadata($event); }
protected function setHelperExpectation($isTaggable, $entityIdentifierFieldName = 'id') { $this->taggableHelper->expects($this->any())->method('isTaggable')->willReturn($isTaggable); $this->doctrineHelper->expects($this->any())->method('getSingleEntityIdentifierFieldName')->willReturn($entityIdentifierFieldName); }
protected function setHelperExpectation($isTaggable) { $this->helper->expects($this->once())->method('isTaggable')->willReturn($isTaggable); }