ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
ExamplesYamlParserTest.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
use
ILIAS\UI\Implementation\Crawler
as
Crawler
;
22
use
PHPUnit\Framework\TestCase
;
23
24
class
ExamplesYamlParserTest
extends
TestCase
25
{
26
protected
Crawler\EntriesYamlParser
$parser
;
27
28
protected
function
setUp
(): void
29
{
30
$this->parser =
new
class
() extends
Crawler
\ExamplesYamlParser {
31
public
function
_getYamlEntriesFromString(
string
$content): array
32
{
33
return
$this->getYamlEntriesFromString($content);
34
}
35
};
36
}
37
38
public
function
testProperEntry
(): void
39
{
40
$doc = <<<EOT
41
some other code here
42
54
function
something()
55
{
56
}
57
EOT;
58
$expected = [
59
'description'
=>
"\nExample showing..."
,
60
'expected output'
=>
"\nILIAS shows the expected output.\nAt least, it should."
61
];
62
63
$this->assertEquals(
64
$expected,
65
$this->parser->_getYamlEntriesFromString($doc)
66
);
67
68
}
69
70
public
function
testMissingBoundaries
(): void
71
{
72
$doc = <<<EOT
78
EOT;
79
$this->assertEquals([], $this->parser->_getYamlEntriesFromString($doc));
80
}
81
82
83
}
ExamplesYamlParserTest\testProperEntry
testProperEntry()
Definition:
ExamplesYamlParserTest.php:38
ExamplesYamlParserTest\testMissingBoundaries
testMissingBoundaries()
Definition:
ExamplesYamlParserTest.php:61
ExamplesYamlParserTest\setUp
setUp()
Definition:
ExamplesYamlParserTest.php:28
ExamplesYamlParserTest\$parser
Crawler EntriesYamlParser $parser
Definition:
ExamplesYamlParserTest.php:26
ILIAS\UI\Implementation\Crawler
Definition:
Crawler.php:21
ExamplesYamlParserTest
Definition:
ExamplesYamlParserTest.php:24
TestCase
TestCase
components
ILIAS
UI
tests
Crawler
ExamplesYamlParserTest.php
Generated on Sun Aug 31 2025 23:04:17 for ILIAS by
1.8.13 (using
Doxyfile
)