Class MediaTest.
More...
◆ setUp()
ILIAS\GlobalScreen\Scope\Layout\MediaTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 39 of file MediaTest.php.
42 $this->version =
'1.2.3.4.5.6.7.8.9';
43 $this->meta_content =
new MetaContent(
◆ testAddCssFile()
ILIAS\GlobalScreen\Scope\Layout\MediaTest::testAddCssFile |
( |
| ) |
|
◆ testAddCssFileWithQuery()
ILIAS\GlobalScreen\Scope\Layout\MediaTest::testAddCssFileWithQuery |
( |
| ) |
|
Definition at line 65 of file MediaTest.php.
References $path, and ILIAS\GlobalScreen\Scope\Layout\MetaContent\MetaContent\MEDIA_SCREEN.
67 $path =
'/path/to/file.css?my=query';
68 $this->meta_content->addCss(
$path);
69 $collection = $this->meta_content->getCss();
71 $iterator_to_array = iterator_to_array($collection->getItems());
72 $first_item = array_shift($iterator_to_array);
73 $this->assertInstanceOf(Css::class, $first_item);
74 $this->assertSame(
$path .
'&version=' . $this->version, $first_item->getContent());
◆ testAddInlineCss()
ILIAS\GlobalScreen\Scope\Layout\MediaTest::testAddInlineCss |
( |
| ) |
|
Definition at line 78 of file MediaTest.php.
References ILIAS\GlobalScreen\Scope\Layout\MetaContent\MetaContent\MEDIA_SCREEN.
80 $css =
'body {background-color:red;}';
81 $this->meta_content->addInlineCss($css);
82 $collection = $this->meta_content->getInlineCss();
84 $first_item = iterator_to_array($collection->getItems())[0];
85 $this->assertInstanceOf(InlineCss::class, $first_item);
86 $this->assertSame($css, $first_item->getContent());
◆ testAddJsFile()
ILIAS\GlobalScreen\Scope\Layout\MediaTest::testAddJsFile |
( |
| ) |
|
Definition at line 90 of file MediaTest.php.
References $path.
92 $path =
'/path/to/file.js';
93 $this->meta_content->addJs(
$path);
94 $collection = $this->meta_content->getJs();
96 $iterator_to_array = iterator_to_array($collection->getItems());
97 $first_item = $iterator_to_array[
$path];
98 $this->assertInstanceOf(Js::class, $first_item);
99 $this->assertSame(
$path .
'?version=' . $this->version, $first_item->getContent());
100 $this->assertSame(2, $first_item->getBatch());
◆ testAddJsFileWithQuery()
ILIAS\GlobalScreen\Scope\Layout\MediaTest::testAddJsFileWithQuery |
( |
| ) |
|
Definition at line 103 of file MediaTest.php.
References $path.
105 $path =
'/path/to/file.js';
106 $path_with_query =
$path .
'?my=query';
107 $this->meta_content->addJs($path_with_query);
108 $collection = $this->meta_content->getJs();
110 $first_item = iterator_to_array($collection->getItems())[
$path];
111 $this->assertInstanceOf(Js::class, $first_item);
112 $this->assertSame($path_with_query .
'&version=' . $this->version, $first_item->getContent());
113 $this->assertSame(2, $first_item->getBatch());
◆ $meta_content
MetaContent ILIAS\GlobalScreen\Scope\Layout\MediaTest::$meta_content |
◆ $version
string ILIAS\GlobalScreen\Scope\Layout\MediaTest::$version |
The documentation for this class was generated from the following file: