ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
EditorEditSessionRepositoryTest.php
Go to the documentation of this file.
1<?php
2
19use PHPUnit\Framework\TestCase;
20
26class EditorEditSessionRepositoryTest extends TestCase
27{
28 //protected $backupGlobals = false;
29 protected \ILIAS\COPage\Editor\EditSessionRepository $repo;
30
31 protected function setUp(): void
32 {
33 parent::setUp();
34 $this->repo = new \ILIAS\COPage\Editor\EditSessionRepository();
35 $this->repo->clear();
36 }
37
38 protected function tearDown(): void
39 {
40 }
41
45 public function testClear(): void
46 {
48 $repo->setPageError("page_error");
49 $repo->setSubCmd("sub_cmd");
50 $repo->setQuestionPool(4);
51 $repo->setTextLang(10, "en");
52 $repo->setMediaPool(5);
53 $repo->clear([10]);
54 $this->assertEquals(
55 "00",
56 $repo->getPageError() .
57 $repo->getSubCmd() .
58 $repo->getTextLang(4) .
59 $repo->getMediaPool() .
60 $repo->getQuestionPool()
61 );
62 }
63
67 public function testPageError(): void
68 {
70 $repo->setPageError("page_error");
71 $this->assertEquals(
72 "page_error",
73 $repo->getPageError()
74 );
75 }
76
80 public function testSubCmd(): void
81 {
83 $repo->setSubCmd("sub");
84 $this->assertEquals(
85 "sub",
86 $repo->getSubCmd()
87 );
88 }
89
93 public function testQuestionPool(): void
94 {
96 $repo->setQuestionPool(15);
97 $this->assertEquals(
98 15,
99 $repo->getQuestionPool()
100 );
101 }
102
106 public function testMediaPool(): void
107 {
109 $repo->setMediaPool(12);
110 $this->assertEquals(
111 12,
112 $repo->getMediaPool()
113 );
114 }
115
119 public function testTextLang(): void
120 {
122 $repo->setTextLang(17, "fr");
123 $this->assertEquals(
124 "fr",
125 $repo->getTextLang(17)
126 );
127 }
128}
ILIAS COPage Editor EditSessionRepository $repo