@@ 66-79 (lines=14) @@ | ||
63 | ); |
|
64 | } |
|
65 | ||
66 | public function testWithAuthority() |
|
67 | { |
|
68 | $statement = $this->createMinimalStatement(); |
|
69 | $authority = $this->createAgent(); |
|
70 | $statementWithAuthority = $statement->withAuthority($authority); |
|
71 | ||
72 | $this->assertFalse($statement->equals($statementWithAuthority)); |
|
73 | $this->assertNull($statement->getAuthority()); |
|
74 | $this->assertSame($statement->getId(), $statementWithAuthority->getId()); |
|
75 | $this->assertTrue($statement->getActor()->equals($statementWithAuthority->getActor())); |
|
76 | $this->assertTrue($statement->getVerb()->equals($statementWithAuthority->getVerb())); |
|
77 | $this->assertTrue($statement->getObject()->equals($statementWithAuthority->getObject())); |
|
78 | $this->assertTrue($authority->equals($statementWithAuthority->getAuthority())); |
|
79 | } |
|
80 | ||
81 | public function testWithAuthorityReplacesExistingAuthority() |
|
82 | { |
|
@@ 81-94 (lines=14) @@ | ||
78 | $this->assertTrue($authority->equals($statementWithAuthority->getAuthority())); |
|
79 | } |
|
80 | ||
81 | public function testWithAuthorityReplacesExistingAuthority() |
|
82 | { |
|
83 | $statement = $this->createStatementWithGroupAuthority(); |
|
84 | $agentAuthority = $this->createAgent(); |
|
85 | $statementWithAuthority = $statement->withAuthority($agentAuthority); |
|
86 | ||
87 | $this->assertFalse($statement->equals($statementWithAuthority)); |
|
88 | $this->assertSame($statement->getId(), $statementWithAuthority->getId()); |
|
89 | $this->assertTrue($statement->getActor()->equals($statementWithAuthority->getActor())); |
|
90 | $this->assertTrue($statement->getVerb()->equals($statementWithAuthority->getVerb())); |
|
91 | $this->assertTrue($statement->getObject()->equals($statementWithAuthority->getObject())); |
|
92 | $this->assertTrue($agentAuthority->equals($statementWithAuthority->getAuthority())); |
|
93 | $this->assertFalse($statement->getAuthority()->equals($statementWithAuthority->getAuthority())); |
|
94 | } |
|
95 | ||
96 | private function createMinimalStatement() |
|
97 | { |