|
static | encodeXml (string $str) |
| Little helper function for encoding XML entities.
|
|
static | normalizeAbout (string $str) |
| Strip the actual about id from the string.
|
|
static | normalizeOut ( $domBody, array $options=[]) |
| Specialized normalization of the PHP parser & Parsoid output, to ignore a few known-ok differences in parser test runs.
|
|
static | unwrapSpansAndNormalizeIEW (Element $body, ?string $stripSpanTypeof=null, bool $parsoidOnly=false, bool $preserveIEW=false) |
| Normalize newlines in IEW to spaces instead.
|
|
static | normalizePhpOutput (string $html) |
| Strip some php output we aren't generating.
|
|
static | normalizeHTML (string $source) |
| Normalize the expected parser output by parsing it using a HTML5 parser and re-serializing it to HTML.
|
|
static | colorString (string $string, string $color, bool $inverse=false) |
|
◆ colorString()
static Wikimedia\Parsoid\ParserTests\TestUtils::colorString |
( |
string | $string, |
|
|
string | $color, |
|
|
bool | $inverse = false ) |
|
static |
- Parameters
-
string | $string | |
string | $color | |
bool | $inverse | |
- Returns
- string @suppress PhanUndeclaredClassMethod @suppress UnusedSuppression
◆ encodeXml()
static Wikimedia\Parsoid\ParserTests\TestUtils::encodeXml |
( |
string | $str | ) |
|
|
static |
Little helper function for encoding XML entities.
- Parameters
-
- Returns
- string
◆ normalizeAbout()
static Wikimedia\Parsoid\ParserTests\TestUtils::normalizeAbout |
( |
string | $str | ) |
|
|
static |
Strip the actual about id from the string.
- Parameters
-
- Returns
- string
◆ normalizeHTML()
static Wikimedia\Parsoid\ParserTests\TestUtils::normalizeHTML |
( |
string | $source | ) |
|
|
static |
Normalize the expected parser output by parsing it using a HTML5 parser and re-serializing it to HTML.
Ideally, the parser would normalize inter-tag whitespace for us. For now, we fake that by simply stripping all newlines.
- Parameters
-
- Returns
- string
◆ normalizeOut()
static Wikimedia\Parsoid\ParserTests\TestUtils::normalizeOut |
( |
| $domBody, |
|
|
array | $options = [] ) |
|
static |
Specialized normalization of the PHP parser & Parsoid output, to ignore a few known-ok differences in parser test runs.
This code is also used by the Parsoid round-trip testing code.
If parsoidOnly is true-ish, we allow more markup through (like property and typeof attributes), for better checking of parsoid-only test cases.
- Parameters
-
Element | string | $domBody | |
array | $options |
- parsoidOnly (bool) Is this test Parsoid Only? Optional. Default: false
- preserveIEW (bool) Should inter-element WS be preserved? Optional. Default: false
- hackyNormalize (bool) Apply the normalizer to the html. Optional. Default: false
|
- Returns
- string
◆ normalizePhpOutput()
static Wikimedia\Parsoid\ParserTests\TestUtils::normalizePhpOutput |
( |
string | $html | ) |
|
|
static |
Strip some php output we aren't generating.
- Parameters
-
- Returns
- string
◆ unwrapSpansAndNormalizeIEW()
static Wikimedia\Parsoid\ParserTests\TestUtils::unwrapSpansAndNormalizeIEW |
( |
Element | $body, |
|
|
?string | $stripSpanTypeof = null, |
|
|
bool | $parsoidOnly = false, |
|
|
bool | $preserveIEW = false ) |
|
static |
Normalize newlines in IEW to spaces instead.
- Parameters
-
Element | $body | The document body node to normalize. |
?string | $stripSpanTypeof | Regular expression to strip typeof attributes |
bool | $parsoidOnly | |
bool | $preserveIEW | |
- Returns
- Element
The documentation for this class was generated from the following file:
- src/ParserTests/TestUtils.php