ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTestCase Class Reference
+ Inheritance diagram for ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTestCase:
+ Collaboration diagram for ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTestCase:

Public Member Functions

 testConstruct ()
 
 testMatches ()
 
 testMatchesIgnored ()
 
 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()

ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTestCase::mock ( string  $className)
private

Definition at line 84 of file ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTestCase.php.

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

85  {
86  return $this->getMockBuilder($className)->disableOriginalConstructor()->getMock();
87  }
+ Here is the caller graph for this function:

◆ testConstruct()

ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTestCase::testConstruct ( )

Definition at line 25 of file ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTestCase.php.

References $relation, and mock().

25  : void
26  {
27  $relation = $this->mock(ilBuddySystemRelation::class);
28  $this->assertInstanceOf(
29  Approve::class,
30  new Approve($relation)
31  );
32  }
$relation
+ Here is the call graph for this function:

◆ testInvoke()

ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTestCase::testInvoke ( )

Definition at line 74 of file ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTestCase.php.

References $relation, and mock().

74  : void
75  {
76  $relation = $this->mock(ilBuddySystemRelation::class);
77  $state = $this->mock(ilBuddySystemLinkedRelationState::class);
78 
79  $instance = new Approve($relation);
80 
81  $this->assertTrue($instance($state));
82  }
$relation
+ Here is the call graph for this function:

◆ testInvokeFalse()

ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTestCase::testInvokeFalse ( )

Definition at line 64 of file ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTestCase.php.

References $relation, and mock().

64  : void
65  {
66  $relation = $this->mock(ilBuddySystemRelation::class);
67  $state = $this->mock(ilBuddySystemRelationState::class);
68 
69  $instance = new Approve($relation);
70 
71  $this->assertFalse($instance($state));
72  }
$relation
+ Here is the call graph for this function:

◆ testMatches()

ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTestCase::testMatches ( )

Definition at line 34 of file ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTestCase.php.

References $relation, and mock().

34  : void
35  {
36  $relation = $this->mock(ilBuddySystemRelation::class);
37  $relation->expects(self::once())->method('isIgnored')->willReturn(true);
38  $relation->expects(self::once())->method('isOwnedByActor')->willReturn(false);
39  $instance = new Approve($relation);
40 
41  $this->assertTrue($instance->matches());
42  }
$relation
+ Here is the call graph for this function:

◆ testMatchesIgnored()

ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTestCase::testMatchesIgnored ( )

Definition at line 44 of file ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTestCase.php.

References $relation, and mock().

44  : void
45  {
46  $relation = $this->mock(ilBuddySystemRelation::class);
47  $relation->expects(self::once())->method('isIgnored')->willReturn(false);
48  $relation->expects(self::never())->method('isOwnedByActor');
49  $instance = new Approve($relation);
50 
51  $this->assertFalse($instance->matches());
52  }
$relation
+ Here is the call graph for this function:

◆ testMatchesOwned()

ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTestCase::testMatchesOwned ( )

Definition at line 54 of file ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTestCase.php.

References $relation, and mock().

54  : void
55  {
56  $relation = $this->mock(ilBuddySystemRelation::class);
57  $relation->expects(self::once())->method('isIgnored')->willReturn(true);
58  $relation->expects(self::once())->method('isOwnedByActor')->willReturn(true);
59  $instance = new Approve($relation);
60 
61  $this->assertFalse($instance->matches());
62  }
$relation
+ Here is the call graph for this function:

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