◆ getUIFactory()
Component\Progress\BarTest::getUIFactory |
( |
| ) |
|
Definition at line 105 of file BarTest.php.
References ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\symbol().
Referenced by Component\Progress\BarTest\testRender(), and Component\Progress\BarTest\testRenderWithAsyncUrl().
107 $symbol_factory =
new I\Symbol\Factory(
108 $this->createMock(
I\Symbol\
Icon\Factory::class),
109 $this->glyph_factory,
110 $this->createMock(
I\Symbol\Avatar\Factory::class),
113 $progress_factory =
new I\Progress\Factory(
114 $this->createMock(
C\Progress\AsyncRefreshInterval::class),
115 $this->signal_generator,
116 $this->createMock(
I\Progress\State\Factory::class),
119 return new class ($progress_factory, $symbol_factory) extends \
NoUIFactory {
121 protected I\Progress\Factory $progress_factory,
122 protected I\Symbol\Factory $symbol_factory,
125 public function progress():
I\Progress\Factory
127 return $this->progress_factory;
129 public function symbol():
I\Symbol\Factory
131 return $this->symbol_factory;
__construct(Container $dic, ilPlugin $plugin)
◆ setUp()
Component\Progress\BarTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 40 of file BarTest.php.
42 $this->glyph_html = sha1(
C\Symbol\Glyph\Glyph::class);
44 $this->glyph_mock = $this->createMock(
I\Symbol\Glyph\Glyph::class);
45 $this->glyph_mock->method(
'getCanonicalName')->willReturn($this->glyph_html);
47 $this->glyph_factory = $this->createMock(
I\Symbol\Glyph\Factory::class);
48 $this->glyph_factory->method(
'apply')->willReturn($this->glyph_mock);
49 $this->glyph_factory->method(
'close')->willReturn($this->glyph_mock);
51 $this->uri = sha1(
'https://example.com?foo=bar&bar=foobar');
53 $this->uri_mock = $this->createMock(\
ILIAS\
Data\URI::class);
54 $this->uri_mock->method(
'__toString')->willReturn($this->uri);
56 $this->signal_generator = new \IncrementalSignalGenerator();
Interface Observer Contains several chained tasks and infos about them.
◆ testRender()
Component\Progress\BarTest::testRender |
( |
| ) |
|
Definition at line 61 of file BarTest.php.
References $renderer, Component\Progress\BarTest\getUIFactory(), and null.
63 $label = sha1(
'progress_bar_label');
65 $progress_bar = $this->
getUIFactory()->progress()->bar($label);
67 $renderer = $this->getDefaultRenderer(
null, [$this->glyph_mock]);
69 $actual_html =
$renderer->render($progress_bar);
71 $expected_html = <<<EOT
72 <div
class=
"c-progress c-progress-bar">
73 <div
class=
"c-progress-bar__label"><label
for=
"id_1">$label</label>
74 <span data-status=
"success" class=
"c-progress-bar--success hidden">$this->glyph_html</span>
75 <span data-status=
"failure" class=
"c-progress-bar--failure hidden">$this->glyph_html</span>
77 <progress
id=
"id_1" class=
"c-progress-bar__progress" value=
"0" max=
"100"></progress>
78 <div
class=
"c-progress-bar__message text-left invisible" aria-live=
"polite"></div>
83 $this->brutallyTrimHTML($expected_html),
84 $this->brutallyTrimHTML($actual_html),
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ testRenderWithAsyncUrl()
Component\Progress\BarTest::testRenderWithAsyncUrl |
( |
| ) |
|
Definition at line 88 of file BarTest.php.
References $renderer, Component\Progress\BarTest\getUIFactory(), and null.
90 $label = sha1(
'progress_bar_label');
92 $progress_bar = $this->
getUIFactory()->progress()->bar($label, $this->uri_mock);
94 $renderer = $this->getDefaultRenderer(
null, [$this->glyph_mock]);
96 $actual_html =
$renderer->render($progress_bar);
98 $expected_html =
"data-url=\"$this->uri\"";
101 str_contains($actual_html, $expected_html)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ $glyph_factory
I Symbol Glyph Factory Component\Progress\BarTest::$glyph_factory |
|
protected |
◆ $glyph_html
string Component\Progress\BarTest::$glyph_html |
|
protected |
◆ $glyph_mock
I Symbol Glyph Glyph Component\Progress\BarTest::$glyph_mock |
|
protected |
◆ $signal_generator
I SignalGeneratorInterface Component\Progress\BarTest::$signal_generator |
|
protected |
◆ $uri
string Component\Progress\BarTest::$uri |
|
protected |
◆ $uri_mock
ILIAS Data URI Component\Progress\BarTest::$uri_mock |
|
protected |
The documentation for this class was generated from the following file:
- components/ILIAS/UI/tests/Component/Progress/BarTest.php