Skip to content

Commit 92fda0a

Browse files
committed
Update tests
1 parent 92ced0a commit 92fda0a

File tree

2 files changed

+29
-18
lines changed

2 files changed

+29
-18
lines changed

packages/playground/data-liberation/tests/WPHTMLToBlocksTests.php

+15-4
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,22 @@ public function provider_test_conversion() {
131131
<!-- wp:table --><figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Header 1 </th><th>Header 2 </th></tr></thead><tbody><tr><td>Cell 1 </td><td>Cell 2 </td></tr><tr><td>Cell 3 </td><td>Cell 4 </td></tr></tbody><tfoot><tr><td>Footer 1 </td><td>Footer 2 </td></tr></tfoot></table></figure><!-- /wp:table -->
132132
HTML
133133
],
134-
'An excerpt from an HTML file' => [
135-
'html' => file_get_contents( __DIR__ . '/fixtures/html-to-blocks/excerpt.input.html' ),
136-
'expected' => file_get_contents( __DIR__ . '/fixtures/html-to-blocks/excerpt.output.html' ),
137-
],
138134
];
139135
}
140136

137+
public function test_html_to_blocks_excerpt() {
138+
$input = file_get_contents( __DIR__ . '/fixtures/html-to-blocks/excerpt.input.html' );
139+
$converter = new WP_HTML_To_Blocks( $input );
140+
$converter->convert( $input );
141+
$blocks = $converter->get_block_markup();
142+
143+
$output_file = __DIR__ . '/fixtures/html-to-blocks/excerpt.output.html';
144+
if (getenv('UPDATE_FIXTURES')) {
145+
file_put_contents( $output_file, $blocks );
146+
}
147+
148+
$this->assertEquals( file_get_contents( $output_file ), $blocks );
149+
150+
}
151+
141152
}

packages/playground/data-liberation/tests/fixtures/html-to-blocks/excerpt.output.html

+14-14
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@ <h2>Full table of contents</h2>
12361236
<!-- wp:list-item -->
12371237
<li>
12381238
<a href="#charset">
1239-
4.2.5.4 Specifying the document&apos;s
1239+
4.2.5.4 Specifying the document&#039;s
12401240
character encoding
12411241
</a>
12421242
</li>
@@ -2333,10 +2333,10 @@ <h2>Full table of contents</h2>
23332333
<!-- wp:list-item -->
23342334
<li>
23352335
<a
2336-
href="#a-purely-decorative-image-that-doesn't-add-any-information"
2336+
href="#a-purely-decorative-image-that-doesn&#039;t-add-any-information"
23372337
>
23382338
4.8.4.4.8 A purely decorative image
2339-
that doesn&apos;t add any
2339+
that doesn&#039;t add any
23402340
information
23412341
</a>
23422342
</li>
@@ -2896,8 +2896,8 @@ <h2>Full table of contents</h2>
28962896
<ul class="wp-block-list">
28972897
<!-- wp:list-item -->
28982898
<li>
2899-
<a href="#writing-a-form's-user-interface">
2900-
4.10.1.1 Writing a form&apos;s user
2899+
<a href="#writing-a-form&#039;s-user-interface">
2900+
4.10.1.1 Writing a form&#039;s user
29012901
interface
29022902
</a>
29032903
</li>
@@ -3400,8 +3400,8 @@ <h2>Full table of contents</h2>
34003400
<ul class="wp-block-list">
34013401
<!-- wp:list-item -->
34023402
<li>
3403-
<a href="#a-form-control's-value">
3404-
4.10.17.1 A form control&apos;s value
3403+
<a href="#a-form-control&#039;s-value">
3404+
4.10.17.1 A form control&#039;s value
34053405
</a>
34063406
</li>
34073407
<!-- /wp:list-item -->
@@ -4340,10 +4340,10 @@ <h2>Full table of contents</h2>
43404340
<!-- wp:list-item -->
43414341
<li>
43424342
<a
4343-
href="#case-sensitivity-of-the-css-'attr()'-function"
4343+
href="#case-sensitivity-of-the-css-&#039;attr()&#039;-function"
43444344
>
43454345
4.16.1 Case-sensitivity of the CSS
4346-
&apos;attr()&apos; function
4346+
&#039;attr()&#039; function
43474347
</a>
43484348
</li>
43494349
<!-- /wp:list-item -->
@@ -5987,7 +5987,7 @@ <h2>Full table of contents</h2>
59875987
<li>
59885988
<a href="#read-ua-inline">
59895989
7.5.7 Loading a document for inline content that
5990-
doesn&apos;t have a DOM
5990+
doesn&#039;t have a DOM
59915991
</a>
59925992
</li>
59935993
<!-- /wp:list-item -->
@@ -7098,8 +7098,8 @@ <h2>Full table of contents</h2>
70987098
<!-- /wp:list-item -->
70997099
<!-- wp:list-item -->
71007100
<li>
7101-
<a href="#the-worker's-lifetime">
7102-
10.2.3 The worker&apos;s lifetime
7101+
<a href="#the-worker&#039;s-lifetime">
7102+
10.2.3 The worker&#039;s lifetime
71037103
</a>
71047104
</li>
71057105
<!-- /wp:list-item -->
@@ -7308,7 +7308,7 @@ <h2>Full table of contents</h2>
73087308
<!-- wp:list-item -->
73097309
<li>
73107310
<a href="#worklets-lifetime">
7311-
11.3.3 The worklet&apos;s lifetime
7311+
11.3.3 The worklet&#039;s lifetime
73127312
</a>
73137313
</li>
73147314
<!-- /wp:list-item -->
@@ -9160,7 +9160,7 @@ <h3>1.3 Background <a href="#background"> </a></h3>
91609160
<!-- /wp:paragraph -->
91619161
<!-- wp:paragraph -->
91629162
<p>
9163-
HTML is the World Wide Web&apos;s core markup language. Originally, HTML was
9163+
HTML is the World Wide Web&#039;s core markup language. Originally, HTML was
91649164
primarily designed as a language for semantically describing scientific
91659165
documents. Its general design, however, has enabled it to be adapted, over
91669166
the subsequent years, to describe a number of other types of documents and

0 commit comments

Comments
 (0)