ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
DecoratedRendererTest.php
Go to the documentation of this file.
1 <?php
2 
3 /******************************************************************************
4  *
5  * This file is part of ILIAS, a powerful learning management system
6  * published by ILIAS open source e-Learning e.V.
7  *
8  * ILIAS is licensed with the GPL-3.0,
9  * see https://www.gnu.org/licenses/gpl-3.0.en.html
10  * You should have received a copy of said license along with the
11  * source code, too.
12  *
13  * If this is not the case or you just want to try ILIAS, you'll find
14  * us at:
15  * https://www.ilias.de
16  * https://github.com/ILIAS-eLearning
17  *
18  *****************************************************************************/
19 
20 require_once(__DIR__ . "/TestComponent.php");
21 require_once(__DIR__ . "/../Base.php");
22 
25 
27 {
28  public function test_render()
29  {
30  $c1 = new TestComponent("foo");
31  $renderer = $this->getDecoratedRenderer($this->getDefaultRenderer());
32  $html = $renderer->render($c1);
33  $this->assertEquals("foo", $html);
34  }
35 
36  public function test_render_async()
37  {
38  $c1 = new TestComponent("foo");
39  $renderer = $this->getDecoratedRenderer($this->getDefaultRenderer());
40  $html = $renderer->renderAsync($c1);
41  $this->assertEquals("foo", $html);
42  }
43 
45  {
46  $c1 = new TestComponent("foo");
47  $renderer = $this->getDecoratedRenderer($this->getDefaultRenderer());
48  $renderer->manipulate();
49  $html = $renderer->render($c1);
50  $this->assertEquals("This content was manipulated", $html);
51  }
52 }
getDecoratedRenderer(Renderer $default)
Definition: Base.php:312
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Definition: Base.php:268
Provides common functionality for UI tests.
Definition: Base.php:224