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

Public Member Functions

 testRuleAssignement ()
 
 testWildcardRuleAssignement ()
 

Protected Member Functions

 setUp ()
 
 tearDown ()
 

Private Attributes

Container $dic_backup
 

Detailed Description

Definition at line 24 of file ilServicesAuthShibbolethTest.php.

Member Function Documentation

◆ setUp()

ilServicesAuthShibbolethTest::setUp ( )
protected

Definition at line 28 of file ilServicesAuthShibbolethTest.php.

References $DIC.

28  : void
29  {
30  global $DIC;
31  $this->dic_backup = is_object($DIC) ? clone $DIC : $DIC;
32 
33  $DIC = new Container();
34  $DIC['ilDB'] = $this->createMock(ilDBInterface::class);
35  }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
global $DIC
Definition: shib_login.php:22

◆ tearDown()

ilServicesAuthShibbolethTest::tearDown ( )
protected

Definition at line 37 of file ilServicesAuthShibbolethTest.php.

References $DIC, and $dic_backup.

37  : void
38  {
39  global $DIC;
40  $DIC = $this->dic_backup;
41  }
global $DIC
Definition: shib_login.php:22

◆ testRuleAssignement()

ilServicesAuthShibbolethTest::testRuleAssignement ( )

Definition at line 43 of file ilServicesAuthShibbolethTest.php.

43  : void
44  {
45  $rule = new ilShibbolethRoleAssignmentRule();
46  $rule->setName('attribute_1');
47  $rule->setValue('value_1');
48 
49  $this->assertTrue($rule->matches(['attribute_1' => 'value_1']));
50  $this->assertFalse($rule->matches(['attribute_2' => 'value_2']));
51  }

◆ testWildcardRuleAssignement()

ilServicesAuthShibbolethTest::testWildcardRuleAssignement ( )

Definition at line 53 of file ilServicesAuthShibbolethTest.php.

53  : void
54  {
55  $rule = new ilShibbolethRoleAssignmentRule();
56  $rule->setName('attribute_1');
57  $rule->setValue('value_*');
58 
59  $this->assertTrue($rule->matches(['attribute_1' => 'value_1']));
60  $this->assertTrue($rule->matches(['attribute_1' => 'value_2']));
61  $this->assertFalse($rule->matches(['attribute_2' => 'value_2']));
62  }

Field Documentation

◆ $dic_backup

Container ilServicesAuthShibbolethTest::$dic_backup
private

Definition at line 26 of file ilServicesAuthShibbolethTest.php.

Referenced by tearDown().


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