addLimitation() public method

Adds a limitation to the policy - if a Limitation exists with the same identifier the existing limitation is replaced.
public addLimitation ( eZ\Publish\API\Repository\Values\User\Limitation $limitation )
$limitation eZ\Publish\API\Repository\Values\User\Limitation
 /**
  * Tests the PolicyUpdateStruct visitor.
  *
  * @return string
  */
 public function testVisit()
 {
     $visitor = $this->getVisitor();
     $generator = $this->getGenerator();
     $generator->startDocument(null);
     $contentTypeLimitation = new \eZ\Publish\API\Repository\Values\User\Limitation\ContentTypeLimitation();
     $contentTypeLimitation->limitationValues = array(1, 2, 3);
     $policyUpdateStruct = new User\PolicyUpdateStruct();
     $policyUpdateStruct->addLimitation($contentTypeLimitation);
     $visitor->visit($this->getVisitorMock(), $generator, $policyUpdateStruct);
     $result = $generator->endDocument(null);
     $this->assertNotNull($result);
     return $result;
 }