Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F28384914
options.patch
cscott (C. Scott Ananian)
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
cscott
Mar 14 2019, 4:13 AM
2019-03-14 04:13:30 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
options.patch
View Options
diff --git a/tests/ZestTest.php b/tests/ZestTest.php
index b1c08df..ff843eb 100644
--- a/tests/ZestTest.php
+++ b/tests/ZestTest.php
@@ -187,18 +187,20 @@ class ZestTest extends \PHPUnit\Framework\TestCase {
}
return self::toXPath( $parent ) . "/" . $name . "[$count]";
}
- public static function loadHtml( string $filename ) : DOMDocument {
+ public static function loadHtml( string $filename, $options = [] ) : DOMDocument {
$text = file_get_contents( $filename );
- return self::parseHtml( $text );
+ return self::parseHtml( $text, $options );
}
- public static function parseHtml( string $text ) : DOMDocument {
- $domBuilder = new DOM\DOMBuilder;
+ public static function parseHtml( string $text, $options = [] ) : DOMDocument {
+ $domBuilder = new DOM\DOMBuilder( $options + [
+ /* DOM builder options */
+ ] );
$treeBuilder = new TreeBuilder\TreeBuilder( $domBuilder, [
/* tree builder options */
] );
$dispatcher = new TreeBuilder\Dispatcher( $treeBuilder );
- $tokenizer = new Tokenizer\Tokenizer( $dispatcher, $text, [
+ $tokenizer = new Tokenizer\Tokenizer( $dispatcher, $text, $options + [
/* tokenizer options */
] );
$tokenizer->execute( [
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
7180332
Default Alt Text
options.patch (1 KB)
Attached To
Mode
T204595: Evaluate and document performance of RemexHtml vs Domino
Attached
Detach File
Event Timeline
Log In to Comment