ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilBuddySystemRelationStateInitiatorShouldOnlyBeAbleToCancelRequestRuleTestCase Class Reference
+ Inheritance diagram for ilBuddySystemRelationStateInitiatorShouldOnlyBeAbleToCancelRequestRuleTestCase:
+ Collaboration diagram for ilBuddySystemRelationStateInitiatorShouldOnlyBeAbleToCancelRequestRuleTestCase:

Public Member Functions

 testConstruct ()
 
 testMatches ()
 
 testMatchesRequested ()
 
 testMatchesOwned ()
 
 testInvokeFalse ()
 
 testInvoke ()
 

Private Member Functions

 mock (string $className)
 

Additional Inherited Members

- Protected Member Functions inherited from ilBuddySystemBaseTestCase
 setUp ()
 
 tearDown ()
 
 setGlobalVariable (string $name, mixed $value)
 

Detailed Description

Member Function Documentation

◆ mock()

ilBuddySystemRelationStateInitiatorShouldOnlyBeAbleToCancelRequestRuleTestCase::mock ( string  $className)
private

Definition at line 84 of file ilBuddySystemRelationStateInitiatorShouldOnlyBeAbleToCancelRequestRuleTestCase.php.

85 {
86 return $this->getMockBuilder($className)->disableOriginalConstructor()->getMock();
87 }

Referenced by testConstruct(), testInvoke(), testInvokeFalse(), testMatches(), testMatchesOwned(), and testMatchesRequested().

+ Here is the caller graph for this function:

◆ testConstruct()

ilBuddySystemRelationStateInitiatorShouldOnlyBeAbleToCancelRequestRuleTestCase::testConstruct ( )

Definition at line 25 of file ilBuddySystemRelationStateInitiatorShouldOnlyBeAbleToCancelRequestRuleTestCase.php.

25 : void
26 {
27 $relation = $this->mock(ilBuddySystemRelation::class);
28 $this->assertInstanceOf(
29 Cancel::class,
30 new Cancel($relation)
31 );
32 }
$relation

References $relation, and mock().

+ Here is the call graph for this function:

◆ testInvoke()

ilBuddySystemRelationStateInitiatorShouldOnlyBeAbleToCancelRequestRuleTestCase::testInvoke ( )

Definition at line 74 of file ilBuddySystemRelationStateInitiatorShouldOnlyBeAbleToCancelRequestRuleTestCase.php.

74 : void
75 {
76 $relation = $this->mock(ilBuddySystemRelation::class);
77 $state = $this->mock(ilBuddySystemUnlinkedRelationState::class);
78
79 $instance = new Cancel($relation);
80
81 $this->assertTrue($instance($state));
82 }

References $relation, and mock().

+ Here is the call graph for this function:

◆ testInvokeFalse()

ilBuddySystemRelationStateInitiatorShouldOnlyBeAbleToCancelRequestRuleTestCase::testInvokeFalse ( )

Definition at line 64 of file ilBuddySystemRelationStateInitiatorShouldOnlyBeAbleToCancelRequestRuleTestCase.php.

64 : void
65 {
66 $relation = $this->mock(ilBuddySystemRelation::class);
67 $state = $this->mock(ilBuddySystemRelationState::class);
68
69 $instance = new Cancel($relation);
70
71 $this->assertFalse($instance($state));
72 }

References $relation, and mock().

+ Here is the call graph for this function:

◆ testMatches()

ilBuddySystemRelationStateInitiatorShouldOnlyBeAbleToCancelRequestRuleTestCase::testMatches ( )

Definition at line 34 of file ilBuddySystemRelationStateInitiatorShouldOnlyBeAbleToCancelRequestRuleTestCase.php.

34 : void
35 {
36 $relation = $this->mock(ilBuddySystemRelation::class);
37 $relation->expects($this->once())->method('isRequested')->willReturn(true);
38 $relation->expects($this->once())->method('isOwnedByActor')->willReturn(true);
39 $instance = new Cancel($relation);
40
41 $this->assertTrue($instance->matches());
42 }

References $relation, and mock().

+ Here is the call graph for this function:

◆ testMatchesOwned()

ilBuddySystemRelationStateInitiatorShouldOnlyBeAbleToCancelRequestRuleTestCase::testMatchesOwned ( )

Definition at line 54 of file ilBuddySystemRelationStateInitiatorShouldOnlyBeAbleToCancelRequestRuleTestCase.php.

54 : void
55 {
56 $relation = $this->mock(ilBuddySystemRelation::class);
57 $relation->expects($this->once())->method('isRequested')->willReturn(true);
58 $relation->expects($this->once())->method('isOwnedByActor')->willReturn(false);
59 $instance = new Cancel($relation);
60
61 $this->assertFalse($instance->matches());
62 }

References $relation, and mock().

+ Here is the call graph for this function:

◆ testMatchesRequested()

ilBuddySystemRelationStateInitiatorShouldOnlyBeAbleToCancelRequestRuleTestCase::testMatchesRequested ( )

Definition at line 44 of file ilBuddySystemRelationStateInitiatorShouldOnlyBeAbleToCancelRequestRuleTestCase.php.

44 : void
45 {
46 $relation = $this->mock(ilBuddySystemRelation::class);
47 $relation->expects($this->once())->method('isRequested')->willReturn(false);
48 $relation->expects($this->never())->method('isOwnedByActor');
49 $instance = new Cancel($relation);
50
51 $this->assertFalse($instance->matches());
52 }

References $relation, and mock().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: