ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
EditorEditSessionRepositoryTest.php
Go to the documentation of this file.
1 <?php
2 
4 
10 class EditorEditSessionRepositoryTest extends TestCase
11 {
12  //protected $backupGlobals = false;
13  protected \ILIAS\COPage\Editor\EditSessionRepository $repo;
14 
15  protected function setUp(): void
16  {
17  parent::setUp();
18  $this->repo = new \ILIAS\COPage\Editor\EditSessionRepository();
19  $this->repo->clear();
20  }
21 
22  protected function tearDown(): void
23  {
24  }
25 
29  public function testClear(): void
30  {
31  $repo = $this->repo;
32  $repo->setPageError("page_error");
33  $repo->setSubCmd("sub_cmd");
34  $repo->setQuestionPool(4);
35  $repo->setTextLang(10, "en");
36  $repo->setMediaPool(5);
37  $repo->clear([10]);
38  $this->assertEquals(
39  "00",
40  $repo->getPageError() .
41  $repo->getSubCmd() .
42  $repo->getTextLang(4) .
43  $repo->getMediaPool() .
44  $repo->getQuestionPool()
45  );
46  }
47 
51  public function testPageError(): void
52  {
53  $repo = $this->repo;
54  $repo->setPageError("page_error");
55  $this->assertEquals(
56  "page_error",
57  $repo->getPageError()
58  );
59  }
60 
64  public function testSubCmd(): void
65  {
66  $repo = $this->repo;
67  $repo->setSubCmd("sub");
68  $this->assertEquals(
69  "sub",
70  $repo->getSubCmd()
71  );
72  }
73 
77  public function testQuestionPool(): void
78  {
79  $repo = $this->repo;
80  $repo->setQuestionPool(15);
81  $this->assertEquals(
82  15,
83  $repo->getQuestionPool()
84  );
85  }
86 
90  public function testMediaPool(): void
91  {
92  $repo = $this->repo;
93  $repo->setMediaPool(12);
94  $this->assertEquals(
95  12,
96  $repo->getMediaPool()
97  );
98  }
99 
103  public function testTextLang(): void
104  {
105  $repo = $this->repo;
106  $repo->setTextLang(17, "fr");
107  $this->assertEquals(
108  "fr",
109  $repo->getTextLang(17)
110  );
111  }
112 }
ILIAS COPage Editor EditSessionRepository $repo