ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
UITestHelperTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
21 require_once("libs/composer/vendor/autoload.php");
22 
23 require_once(__DIR__ . "/UITestHelper.php");
24 
28 
29 class UITestHelperTest extends TestCase
30 {
31  public function testConstruct(): void
32  {
33  $this->assertInstanceOf("UITestHelper", new UITestHelper());
34  }
35 
36  public function testGetFactory(): void
37  {
38  $this->assertInstanceOf(Factory::class, (new UITestHelper())->factory());
39  }
40 
41  public function testGetRenderer(): void
42  {
43  $this->assertInstanceOf(Renderer::class, (new UITestHelper())->renderer());
44  }
45 
46  public function testGetMainTemplate(): void
47  {
48  $this->assertInstanceOf(ilIndependentGlobalTemplate::class, (new UITestHelper())->mainTemplate());
49  }
50 
51  public function testRenderExample(): void
52  {
53  $helper = new UITestHelper();
54  $c = $helper->factory()->legacy("hello world");
55  $this->assertEquals("hello world", $helper->renderer()->render($c));
56  }
57 }
$c
Definition: cli.php:38
Class UITestHelper can be helpful for test cases outside the UI Components, to inject a working facto...