ILIAS  release_8 Revision v8.24
ilServicesAuthShibbolethTest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5/******************************************************************************
6 *
7 * This file is part of ILIAS, a powerful learning management system.
8 *
9 * ILIAS is licensed with the GPL-3.0, you should have received a copy
10 * of said license along with the source code.
11 *
12 * If this is not the case or you just want to try ILIAS, you'll find
13 * us at:
14 * https://www.ilias.de
15 * https://github.com/ILIAS-eLearning
16 *
17 *****************************************************************************/
18
19use PHPUnit\Framework\TestCase;
21
22class ilServicesAuthShibbolethTest extends TestCase
23{
25
26 protected function setUp(): void
27 {
28 global $DIC;
29 $this->dic_backup = is_object($DIC) ? clone $DIC : $DIC;
30
31 $DIC = new Container();
32 $DIC['ilDB'] = $this->createMock(ilDBInterface::class);
33 }
34
35 protected function tearDown(): void
36 {
37 global $DIC;
39 }
40
41 public function testRuleAssignement(): void
42 {
44 $rule->setName('attribute_1');
45 $rule->setValue('value_1');
46
47 $this->assertTrue($rule->matches(['attribute_1' => 'value_1']));
48 $this->assertFalse($rule->matches(['attribute_2' => 'value_2']));
49 }
50
51 public function testWildcardRuleAssignement(): void
52 {
54 $rule->setName('attribute_1');
55 $rule->setValue('value_*');
56
57 $this->assertTrue($rule->matches(['attribute_1' => 'value_1']));
58 $this->assertTrue($rule->matches(['attribute_1' => 'value_2']));
59 $this->assertFalse($rule->matches(['attribute_2' => 'value_2']));
60 }
61}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
global $DIC
Definition: feed.php:28