示例#1
0
 public function testGetResourceAssociationSetEndIsNotVisible()
 {
     $fakePropName = "Fake Prop";
     Phockito::when($this->mockResourceProperty->getName())->return($fakePropName);
     Phockito::when($this->mockResourceType->resolvePropertyDeclaredOnThisType($fakePropName))->return($this->mockResourceProperty);
     $fakeTypeName = "Fake Type";
     Phockito::when($this->mockResourceType->getName())->return($fakeTypeName);
     $fakeSetName = "Fake Set";
     Phockito::when($this->mockResourceSet->getName())->return($fakeSetName);
     Phockito::when($this->mockResourceSet->getResourceType())->return($this->mockResourceType);
     Phockito::when($this->mockResourceSet2->getResourceType())->return($this->mockResourceType2);
     //Indicate the resource set is visible
     Phockito::when($this->mockServiceConfig->getEntitySetAccessRule($this->mockResourceSet))->return(EntitySetRights::READ_SINGLE);
     //Indicate the resource set is visible
     Phockito::when($this->mockServiceConfig->getEntitySetAccessRule($this->mockResourceSet2))->return(EntitySetRights::NONE);
     Phockito::when($this->mockMetadataProvider->getResourceAssociationSet($this->mockResourceSet, $this->mockResourceType, $this->mockResourceProperty))->return($this->mockResourceAssociationSet);
     Phockito::when($this->mockResourceAssociationSet->getResourceAssociationSetEnd($this->mockResourceSet, $this->mockResourceType, $this->mockResourceProperty))->return($this->mockResourceAssociationSetEnd);
     Phockito::when($this->mockResourceAssociationSet->getRelatedResourceAssociationSetEnd($this->mockResourceSet, $this->mockResourceType, $this->mockResourceProperty))->return($this->mockResourceAssociationSetEnd);
     Phockito::when($this->mockResourceAssociationSetEnd->getResourceSet())->return($this->mockResourceSet2);
     Phockito::when($this->mockResourceAssociationSetEnd->getResourceType())->return($this->mockResourceType2);
     $wrapper = $this->getMockedWrapper();
     $actual = $wrapper->getResourceAssociationSet($this->mockResourceSet, $this->mockResourceType, $this->mockResourceProperty);
     $this->assertNull($actual);
 }