ILIAS  release_8 Revision v8.24
UITestHelperTest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
21require_once("libs/composer/vendor/autoload.php");
22
23require_once(__DIR__ . "/UITestHelper.php");
24
25use PHPUnit\Framework\TestCase;
28
29class 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}
Class UITestHelper can be helpful for test cases outside the UI Components, to inject a working facto...
$c
Definition: cli.php:38
This is how the factory for UI elements looks.
Definition: Factory.php:38
An entity that renders components to a string output.
Definition: Renderer.php:31