ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
LegacyTest.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 2016 Timon Amstutz <timon.amstutz@ilub.unibe.ch> Extended GPL, see docs/LICENSE */
4
5require_once(__DIR__ . "/../../../../libs/composer/vendor/autoload.php");
6require_once(__DIR__ . "/../../Base.php");
7
8use \ILIAS\UI\Component as C;
9
14{
15
19 public function getFactory()
20 {
21 return new \ILIAS\UI\Implementation\Factory(
22 $this->createMock(C\Counter\Factory::class),
23 $this->createMock(C\Glyph\Factory::class),
24 $this->createMock(C\Button\Factory::class),
25 $this->createMock(C\Listing\Factory::class),
26 $this->createMock(C\Image\Factory::class),
27 $this->createMock(C\Panel\Factory::class),
28 $this->createMock(C\Modal\Factory::class),
29 $this->createMock(C\Dropzone\Factory::class),
30 $this->createMock(C\Popover\Factory::class),
31 $this->createMock(C\Divider\Factory::class),
32 $this->createMock(C\Link\Factory::class),
33 $this->createMock(C\Dropdown\Factory::class),
34 $this->createMock(C\Item\Factory::class),
35 $this->createMock(C\Icon\Factory::class),
36 $this->createMock(C\ViewControl\Factory::class),
37 $this->createMock(C\Chart\Factory::class),
38 $this->createMock(C\Input\Factory::class),
39 $this->createMock(C\Table\Factory::class),
40 $this->createMock(C\MessageBox\Factory::class),
41 $this->createMock(C\Card\Factory::class)
42 );
43 }
44
46 {
47 $f = $this->getFactory();
48
49 $this->assertInstanceOf("ILIAS\\UI\\Factory", $f);
50 $this->assertInstanceOf(
51 "ILIAS\\UI\\Component\\Legacy\\Legacy",
52 $f->legacy("Legacy Content")
53 );
54 }
55
56 public function test_get_content()
57 {
58 $f = $this->getFactory();
59 $g = $f->legacy("Legacy Content");
60
61 $this->assertEquals($g->getContent(), "Legacy Content");
62 }
63
64
65 public function test_render_content()
66 {
67 $f = $this->getFactory();
68 $r = $this->getDefaultRenderer();
69
70 $g = $f->legacy("Legacy Content");
71
72 $this->assertEquals($r->render($g), "Legacy Content");
73 }
74}
An exception for terminatinating execution or to throw for unit testing.
Provides common functionality for UI tests.
Definition: Base.php:192
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Definition: Base.php:228
Test on button implementation.
Definition: LegacyTest.php:14
test_get_content()
Definition: LegacyTest.php:56
test_render_content()
Definition: LegacyTest.php:65
test_implements_factory_interface()
Definition: LegacyTest.php:45
$r
Definition: example_031.php:79