ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTest Class Reference
+ Inheritance diagram for ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTest:
+ Collaboration diagram for ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTest:

Public Member Functions

 testConstruct ()
 
 testMatches ()
 
 testMatchesIgnored ()
 
 testMatchesOwned ()
 
 testInvokeFalse ()
 
 testInvoke ()
 

Private Member Functions

 mock (string $className)
 

Additional Inherited Members

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

Detailed Description

Member Function Documentation

◆ mock()

ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTest::mock ( string  $className)
private

Definition at line 84 of file ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTest.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()

ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTest::testConstruct ( )

Definition at line 25 of file ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTest.php.

References mock().

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

◆ testInvoke()

ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTest::testInvoke ( )

Definition at line 74 of file ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTest.php.

References 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  }
+ Here is the call graph for this function:

◆ testInvokeFalse()

ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTest::testInvokeFalse ( )

Definition at line 64 of file ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTest.php.

References 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  }
+ Here is the call graph for this function:

◆ testMatches()

ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTest::testMatches ( )

Definition at line 34 of file ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTest.php.

References 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  }
+ Here is the call graph for this function:

◆ testMatchesIgnored()

ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTest::testMatchesIgnored ( )

Definition at line 44 of file ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTest.php.

References 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  }
+ Here is the call graph for this function:

◆ testMatchesOwned()

ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTest::testMatchesOwned ( )

Definition at line 54 of file ilBuddySystemRelationStateReceiverShouldOnlyBeAbleToApproveIgnoredRequestRuleTest.php.

References 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  }
+ Here is the call graph for this function:

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