ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
UIFilterServiceSessionGatewayTest.php
Go to the documentation of this file.
1 <?php
2 
20 
25 {
27 
28  protected function setUp(): void
29  {
30  parent::setUp();
31  $this->gateway = new ilUIFilterServiceSessionGateway();
32  $this->gateway->reset("filter_id");
33  }
34 
35  protected function tearDown(): void
36  {
37  }
38 
39  public function testClear(): void
40  {
41  $gateway = $this->gateway;
42  $gateway->writeActivated("filter_id", true);
43  $gateway->writeExpanded("filter_id", true);
44  $gateway->writeRendered("filter_id", "input_id", true);
45  $gateway->writeValue("filter_id", "input_id", "a value");
46  $gateway->reset("filter_id");
47 
48  $this->assertEquals(
49  false,
50  $gateway->isActivated("filter_id", false)
51  );
52  $this->assertEquals(
53  false,
54  $gateway->isExpanded("filter_id", false)
55  );
56  $this->assertEquals(
57  false,
58  $gateway->isRendered("filter_id", "input_id", false)
59  );
60  $this->assertEquals(
61  null,
62  $gateway->getValue("filter_id", "input_id")
63  );
64  }
65 
66  public function testFilterActivated(): void
67  {
68  $gateway = $this->gateway;
69  $gateway->writeActivated("filter_id", true);
70  $this->assertEquals(
71  true,
72  $gateway->isActivated("filter_id", false)
73  );
74  }
75 
76  public function testFilterExpanded(): void
77  {
78  $gateway = $this->gateway;
79  $gateway->writeExpanded("filter_id", true);
80  $this->assertEquals(
81  true,
82  $gateway->isExpanded("filter_id", false)
83  );
84  }
85 
86  public function testFilterInputRendered(): void
87  {
88  $gateway = $this->gateway;
89  $gateway->writeRendered("filter_id", "input_id", true);
90  $this->assertEquals(
91  true,
92  $gateway->isRendered("filter_id", "input_id", false)
93  );
94  }
95 
96  public function testFilterInputValue(): void
97  {
98  $gateway = $this->gateway;
99  $gateway->writeValue("filter_id", "input_id", "a value");
100  $this->assertEquals(
101  "a value",
102  $gateway->getValue("filter_id", "input_id")
103  );
104  }
105 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
writeValue(string $filter_id, string $input_id, $value)
Write session value for an input field.
isRendered(string $filter_id, string $input_id, bool $default)
writeRendered(string $filter_id, string $input_id, bool $value)
reset(string $filter_id)
Resets filter to its default state.
getValue(string $filter_id, string $input_id)