Class ilBuddySystemRelationTest.
More...
◆ testPriorStateCanBeRetrievedAfterSubsequentTransitions()
ilBuddySystemRelationTest::testPriorStateCanBeRetrievedAfterSubsequentTransitions |
( |
| ) |
|
Definition at line 43 of file ilBuddySystemRelationTest.php.
45 $stateMock = $this->getMockBuilder(ilBuddySystemRelationState::class)->getMock();
46 $furtherStateMock = $this->getMockBuilder(ilBuddySystemRelationState::class)->getMock();
47 $finishStateMock = $this->getMockBuilder(ilBuddySystemRelationState::class)->getMock();
48 $stateMock->method(
'link');
52 self::RELATION_OWNER_ID,
53 self::RELATION_OWNER_ID,
57 $relation->setState($furtherStateMock);
58 $this->assertEquals($stateMock, $relation->getPriorState());
59 $relation->setState($finishStateMock);
60 $this->assertEquals($stateMock, $relation->getPriorState());
◆ testPriorStateIsEmptyAfterInstanceWasCreated()
ilBuddySystemRelationTest::testPriorStateIsEmptyAfterInstanceWasCreated |
( |
| ) |
|
Definition at line 30 of file ilBuddySystemRelationTest.php.
32 $stateMock = $this->getMockBuilder(ilBuddySystemRelationState::class)->getMock();
35 self::RELATION_OWNER_ID,
36 self::RELATION_OWNER_ID,
40 $this->assertNull($relation->getPriorState());
◆ testUsersAreNotAbleToIgnoreThemselves()
ilBuddySystemRelationTest::testUsersAreNotAbleToIgnoreThemselves |
( |
| ) |
|
Definition at line 140 of file ilBuddySystemRelationTest.php.
142 $this->expectException(ilBuddySystemRelationStateException::class);
143 $stateMock = $this->getMockBuilder(ilBuddySystemRequestedRelationState::class)->getMock();
146 self::RELATION_OWNER_ID,
147 self::RELATION_OWNER_ID,
151 $expectedRelation = $expectedRelation->withUsrId(self::RELATION_OWNER_ID);
152 $expectedRelation = $expectedRelation->withBuddyUsrId(self::RELATION_OWNER_ID);
154 $expectedRelation->ignore();
◆ testUsersAreNotAbleToLinkThemselves()
ilBuddySystemRelationTest::testUsersAreNotAbleToLinkThemselves |
( |
| ) |
|
Definition at line 123 of file ilBuddySystemRelationTest.php.
125 $this->expectException(ilBuddySystemRelationStateException::class);
126 $stateMock = $this->getMockBuilder(ilBuddySystemRequestedRelationState::class)->getMock();
129 self::RELATION_OWNER_ID,
130 self::RELATION_OWNER_ID,
134 $expectedRelation = $expectedRelation->withUsrId(self::RELATION_OWNER_ID);
135 $expectedRelation = $expectedRelation->withBuddyUsrId(self::RELATION_OWNER_ID);
137 $expectedRelation->link();
◆ testUsersAreNotAbleToRequestThemselves()
ilBuddySystemRelationTest::testUsersAreNotAbleToRequestThemselves |
( |
| ) |
|
Definition at line 88 of file ilBuddySystemRelationTest.php.
90 $this->expectException(ilBuddySystemRelationStateException::class);
91 $stateMock = $this->getMockBuilder(ilBuddySystemUnlinkedRelationState::class)->getMock();
94 self::RELATION_OWNER_ID,
95 self::RELATION_OWNER_ID,
100 $expectedRelation = $expectedRelation->withUsrId(self::RELATION_OWNER_ID);
101 $expectedRelation = $expectedRelation->withBuddyUsrId(self::RELATION_OWNER_ID);
103 $expectedRelation->request();
◆ testUsersAreNotAbleToUnlinkThemselves()
ilBuddySystemRelationTest::testUsersAreNotAbleToUnlinkThemselves |
( |
| ) |
|
Definition at line 106 of file ilBuddySystemRelationTest.php.
108 $this->expectException(ilBuddySystemRelationStateException::class);
109 $stateMock = $this->getMockBuilder(ilBuddySystemLinkedRelationState::class)->getMock();
112 self::RELATION_OWNER_ID,
113 self::RELATION_OWNER_ID,
117 $expectedRelation = $expectedRelation->withUsrId(self::RELATION_OWNER_ID);
118 $expectedRelation = $expectedRelation->withBuddyUsrId(self::RELATION_OWNER_ID);
120 $expectedRelation->unlink();
◆ testValuesCanBeFetchedByGettersWhenSetBySetters()
ilBuddySystemRelationTest::testValuesCanBeFetchedByGettersWhenSetBySetters |
( |
| ) |
|
Definition at line 63 of file ilBuddySystemRelationTest.php.
65 $stateMock = $this->getMockBuilder(ilBuddySystemRelationState::class)->getMock();
69 self::RELATION_OWNER_ID,
70 self::RELATION_OWNER_ID,
75 $relation = $relation->withUsrId(1);
76 $this->assertSame(1, $relation->getUsrId());
78 $relation = $relation->withBuddyUsrId(2);
79 $this->assertSame(2, $relation->getBuddyUsrId());
81 $relation = $relation->withTimestamp($ts + 1);
82 $this->assertSame($ts + 1, $relation->getTimestamp());
84 $relation = $relation->withIsOwnedByActor(
true);
85 $this->assertTrue($relation->isOwnedByActor());
◆ RELATION_BUDDY_ID
const ilBuddySystemRelationTest::RELATION_BUDDY_ID = -2 |
|
private |
◆ RELATION_OWNER_ID
const ilBuddySystemRelationTest::RELATION_OWNER_ID = -1 |
|
private |
The documentation for this class was generated from the following file: