ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
AbstractRendererTest Class Reference
+ Inheritance diagram for AbstractRendererTest:
+ Collaboration diagram for AbstractRendererTest:

Public Member Functions

 setUp ()
 
 testGetTemplateSuccessfull ()
 
 testGetTemplateUnsuccessfull ()
 
 testBindJavaScriptSuccessfull ()
 
 testBindJavaScriptNoString ()
 

Protected Attributes

TemplateFactoryMock $tpl_factory
 
NoUIFactory $ui_factory
 
Language $lng
 
LoggingJavaScriptBinding $js_binding
 
 $image_path_resolver
 
ILIAS UI HelpTextRetriever $help_text_retriever
 

Detailed Description

Definition at line 147 of file AbstractRendererTest.php.

Member Function Documentation

◆ setUp()

AbstractRendererTest::setUp ( )

Definition at line 159 of file AbstractRendererTest.php.

159 : void
160 {
161 parent::setUp();
162 $this->tpl_factory = new TemplateFactoryMock();
163 $this->ui_factory = $this->getUIFactory(); //new NoUIFactory();
164 $this->lng = new LanguageMock();
165 $this->js_binding = new LoggingJavaScriptBinding();
166 $this->image_path_resolver = $this->getMockBuilder(ILIAS\UI\Implementation\Render\ImagePathResolver::class)
167 ->getMock();
168 $this->help_text_retriever = $this->createMock(ILIAS\UI\HelpTextRetriever::class);
169 }
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ testBindJavaScriptNoString()

AbstractRendererTest::testBindJavaScriptNoString ( )

Definition at line 241 of file AbstractRendererTest.php.

241 : void
242 {
244 $this->ui_factory,
245 $this->tpl_factory,
246 $this->lng,
247 $this->js_binding,
248 $this->image_path_resolver,
249 $this->getDataFactory(),
250 $this->help_text_retriever,
251 $this->getUploadLimitResolver()
252 );
253
254 $g = new Glyph(C\Symbol\Glyph\Glyph::SETTINGS, "aria_label");
255
256 $g = $g->withOnLoadCode(function ($id) {
257 return null;
258 });
259
260 try {
261 $r->render($g, new NullDefaultRenderer());
262 $this->assertFalse("This should not happen...");
263 } catch (LogicException $e) {
264 $this->assertTrue(true);
265 }
266 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References Vendor\Package\$e, $id, ILIAS\UI\Implementation\Component\Input\getDataFactory(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ testBindJavaScriptSuccessfull()

AbstractRendererTest::testBindJavaScriptSuccessfull ( )

Definition at line 214 of file AbstractRendererTest.php.

214 : void
215 {
217 $this->ui_factory,
218 $this->tpl_factory,
219 $this->lng,
220 $this->js_binding,
221 $this->image_path_resolver,
222 $this->getDataFactory(),
223 $this->help_text_retriever,
224 $this->getUploadLimitResolver()
225 );
226
227 $g = new Glyph(C\Symbol\Glyph\Glyph::SETTINGS, "aria_label");
228
229 $ids = array();
230 $g = $g->withOnLoadCode(function ($id) use (&$ids) {
231 $ids[] = $id;
232 return "ID: $id";
233 });
234 $r->render($g, new NullDefaultRenderer());
235
236 $this->assertEquals($this->js_binding->ids, $ids);
237 $this->assertEquals(array("id_1"), $ids);
238 $this->assertEquals(array("ID: id_1"), $this->js_binding->on_load_code);
239 }

References $id, ILIAS\UI\Implementation\Component\Input\getDataFactory(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ testGetTemplateSuccessfull()

AbstractRendererTest::testGetTemplateSuccessfull ( )

Definition at line 171 of file AbstractRendererTest.php.

171 : void
172 {
174 $this->ui_factory,
175 $this->tpl_factory,
176 $this->lng,
177 $this->js_binding,
178 $this->image_path_resolver,
179 $this->getDataFactory(),
180 $this->help_text_retriever,
181 $this->getUploadLimitResolver()
182 );
183 $r->_getTemplate("tpl.glyph.html", true, false);
184
185 $expected = array(realpath(__DIR__ . "/../../../../../components/ILIAS/UI/src/templates/default/Symbol/tpl.glyph.html")
186 => array(true, false)
187 );
188
189 $this->assertEquals($expected, $this->tpl_factory->files);
190 }

References ILIAS\UI\Implementation\Component\Input\getDataFactory(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ testGetTemplateUnsuccessfull()

AbstractRendererTest::testGetTemplateUnsuccessfull ( )

Definition at line 192 of file AbstractRendererTest.php.

192 : void
193 {
195 $this->ui_factory,
196 $this->tpl_factory,
197 $this->lng,
198 $this->js_binding,
199 $this->image_path_resolver,
200 $this->getDataFactory(),
201 $this->help_text_retriever,
202 $this->getUploadLimitResolver()
203 );
204
205 $this->expectException(TypeError::class);
206 $r->_getTemplate("tpl.counter_foo.html", true, false);
207
208 $expected = array(realpath(__DIR__ . "/../../components/ILIAS/UI/src/templates/default/Counter/tpl.counter_foo.html")
209 => array(true, false)
210 );
211 $this->assertEquals($expected, $this->tpl_factory->files);
212 }

References ILIAS\UI\Implementation\Component\Input\getDataFactory(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Field Documentation

◆ $help_text_retriever

ILIAS UI HelpTextRetriever AbstractRendererTest::$help_text_retriever
protected

Definition at line 157 of file AbstractRendererTest.php.

◆ $image_path_resolver

AbstractRendererTest::$image_path_resolver
protected

Definition at line 156 of file AbstractRendererTest.php.

◆ $js_binding

LoggingJavaScriptBinding AbstractRendererTest::$js_binding
protected

Definition at line 152 of file AbstractRendererTest.php.

◆ $lng

Language AbstractRendererTest::$lng
protected

Definition at line 151 of file AbstractRendererTest.php.

◆ $tpl_factory

TemplateFactoryMock AbstractRendererTest::$tpl_factory
protected

Definition at line 149 of file AbstractRendererTest.php.

◆ $ui_factory

NoUIFactory AbstractRendererTest::$ui_factory
protected

Definition at line 150 of file AbstractRendererTest.php.


The documentation for this class was generated from the following file: