ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
◀ 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
Definition:
ExamplesYamlParserTest.php:25
ExamplesYamlParserTest\setUp
setUp()
Definition:
ExamplesYamlParserTest.php:28
ExamplesYamlParserTest\testProperEntry
testProperEntry()
Definition:
ExamplesYamlParserTest.php:38
ExamplesYamlParserTest\$parser
Crawler EntriesYamlParser $parser
Definition:
ExamplesYamlParserTest.php:26
ExamplesYamlParserTest\testMissingBoundaries
testMissingBoundaries()
Definition:
ExamplesYamlParserTest.php:61
ILIAS\UI\Implementation\Crawler\EntriesYamlParser
Definition:
EntriesYamlParser.php:31
ILIAS\UI\Implementation\Crawler
Definition:
Crawler.php:21
components
ILIAS
UI
tests
Crawler
ExamplesYamlParserTest.php
Generated on Sat Oct 18 2025 23:04:56 for ILIAS by
1.9.4 (using
Doxyfile
)