ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilServicesAuthShibbolethTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use PHPUnit\Framework\TestCase;
23
24class ilServicesAuthShibbolethTest extends TestCase
25{
27
28 protected function setUp(): 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 }
36
37 protected function tearDown(): void
38 {
39 global $DIC;
41 }
42
43 public function testRuleAssignement(): void
44 {
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 }
52
53 public function testWildcardRuleAssignement(): void
54 {
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 }
63}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:26