Skip to content

Commit 484141d

Browse files
committed
Add a new HTMLEntry
1 parent 937d7ed commit 484141d

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/core/etl/tests/Flow/ETL/Tests/Unit/Row/EntryFactoryTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static function provide_recognized_data() : \Generator
6363
];
6464

6565
yield 'html' => [
66-
$html = '<html><body><div id="id">2</div><p>3</p></body></html>',
66+
$html = '<!DOCTYPE html><html><head></head><body><div id="id">2</div><p>3</p></body></html>',
6767
html_entry('e', $html),
6868
];
6969

@@ -252,7 +252,8 @@ public function test_from_empty_string() : void
252252

253253
public function test_html_from_dom_document() : void
254254
{
255-
$doc = HTMLDocument::fromString($html = '<html><body><div>2</div><p>3</p></body></html>');
255+
$doc = HTMLDocument::fromString($html = '<!DOCTYPE html><html><head></head><body><div>2</div><p>3</p></body></html>');
256+
256257
self::assertEquals(
257258
html_entry('e', $html),
258259
$this->entryFactory->create('e', $doc)
@@ -262,15 +263,15 @@ public function test_html_from_dom_document() : void
262263
public function test_html_from_string() : void
263264
{
264265
self::assertEquals(
265-
html_entry('e', $html = '<html><body><div>2</div><p>3</p></body></html>'),
266+
html_entry('e', $html = '<!DOCTYPE html><html><head></head><body><div>foo</div><p>3</p></body></html>'),
266267
$this->entryFactory->create('e', $html)
267268
);
268269
}
269270

270271
public function test_html_string_with_xml_definition_provided() : void
271272
{
272273
self::assertEquals(
273-
html_entry('e', $html = '<html><body><div>2</div><p>3</p></body></html>'),
274+
html_entry('e', $html = '<!DOCTYPE html><html><head></head><body><div>2</div><p>bar</p></body></html>'),
274275
$this->entryFactory->create('e', $html, schema(html_schema('e')))
275276
);
276277
}

0 commit comments

Comments
 (0)