4 require_once
'Services/Contact/BuddySystem/test/ilBuddySystemBaseTest.php';
33 $state_mock = $this->getMockBuilder(
'ilBuddySystemRelationState')->getMock();
35 $this->assertNull($relation->getPriorState());
43 $state_mock = $this->getMockBuilder(
'ilBuddySystemRelationState')->getMock();
44 $further_state_mock = $this->getMockBuilder(
'ilBuddySystemRelationState')->getMock();
45 $finish_state_mock = $this->getMockBuilder(
'ilBuddySystemRelationState')->getMock();
46 $state_mock->expects($this->any())->method(
'link');
49 $relation->setState($further_state_mock);
50 $this->assertEquals($state_mock, $relation->getPriorState());
51 $relation->setState($finish_state_mock);
52 $this->assertEquals($state_mock, $relation->getPriorState());
60 $state_mock = $this->getMockBuilder(
'ilBuddySystemRelationState')->getMock();
63 $relation->setUserId(1);
64 $this->assertEquals(1, $relation->getUserId());
66 $relation->setBuddyUserId(2);
67 $this->assertEquals(2, $relation->getBuddyUserId());
70 $relation->setTimestamp($ts);
71 $this->assertEquals($ts, $relation->getTimestamp());
80 $state_mock = $this->getMockBuilder(
'ilBuddySystemUnlinkedRelationState')->getMock();
83 $expected_relation->setUserId(self::RELATION_OWNER_ID);
84 $expected_relation->setBuddyUserId(self::RELATION_OWNER_ID);
86 $expected_relation->request();
95 $state_mock = $this->getMockBuilder(
'ilBuddySystemLinkedRelationState')->getMock();
97 $expected_relation->setUserId(self::RELATION_OWNER_ID);
98 $expected_relation->setBuddyUserId(self::RELATION_OWNER_ID);
100 $expected_relation->unlink();
109 $state_mock = $this->getMockBuilder(
'ilBuddySystemRequestedRelationState')->getMock();
111 $expected_relation->setUserId(self::RELATION_OWNER_ID);
112 $expected_relation->setBuddyUserId(self::RELATION_OWNER_ID);
114 $expected_relation->link();
123 $state_mock = $this->getMockBuilder(
'ilBuddySystemRequestedRelationState')->getMock();
125 $expected_relation->setUserId(self::RELATION_OWNER_ID);
126 $expected_relation->setBuddyUserId(self::RELATION_OWNER_ID);
128 $expected_relation->ignore();
testUsersAreNotAbleToRequestThemselves()
ilBuddySystemRelationStateException
testValuesCanBeFetchedByGettersWhenSetBySetters()
assertException($exception_class)
testUsersAreNotAbleToUnlinkThemselves()
ilBuddySystemRelationStateException
testUsersAreNotAbleToLinkThemselves()
ilBuddySystemRelationStateException
testPriorStateIsEmptyAfterInstanceWasCreated()
Class ilBuddySystemRelationTest.
testPriorStateCanBeRetrievedAfterSubsequentTransitions()
testUsersAreNotAbleToIgnoreThemselves()
ilBuddySystemRelationStateException
Class ilBuddySystemRelation.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.