@@ -23,10 +23,10 @@ class WP_HTML_Tag_Processor_Bookmark_Test extends WP_UnitTestCase {
23
23
public function test_set_bookmark () {
24
24
$ p = new WP_HTML_Tag_Processor ( '<ul><li>One</li><li>Two</li><li>Three</li></ul> ' );
25
25
$ p ->next_tag ( 'li ' );
26
- $ this ->assertTrue ($ p ->set_bookmark ( 'first li ' ), 'Could not allocate a "first li" bookmark. ' );
26
+ $ this ->assertTrue ( $ p ->set_bookmark ( 'first li ' ), 'Could not allocate a "first li" bookmark. ' );
27
27
$ p ->next_tag ( 'li ' );
28
- $ this ->assertTrue ($ p ->set_bookmark ( 'second li ' ), 'Could not allocate a "second li" bookmark. ' );
29
- $ this ->assertTrue ($ p ->set_bookmark ( 'first li ' ), 'Could not move the "first li" bookmark. ' );
28
+ $ this ->assertTrue ( $ p ->set_bookmark ( 'second li ' ), 'Could not allocate a "second li" bookmark. ' );
29
+ $ this ->assertTrue ( $ p ->set_bookmark ( 'first li ' ), 'Could not move the "first li" bookmark. ' );
30
30
}
31
31
32
32
/**
@@ -37,9 +37,9 @@ public function test_set_bookmark() {
37
37
public function test_release_bookmark () {
38
38
$ p = new WP_HTML_Tag_Processor ( '<ul><li>One</li><li>Two</li><li>Three</li></ul> ' );
39
39
$ p ->next_tag ( 'li ' );
40
- $ this ->assertFalse ($ p ->release_bookmark ( 'first li ' ), 'Released a non-existing bookmark. ' );
40
+ $ this ->assertFalse ( $ p ->release_bookmark ( 'first li ' ), 'Released a non-existing bookmark. ' );
41
41
$ p ->set_bookmark ( 'first li ' );
42
- $ this ->assertTrue ($ p ->release_bookmark ( 'first li ' ), 'Could not release a bookmark. ' );
42
+ $ this ->assertTrue ( $ p ->release_bookmark ( 'first li ' ), 'Could not release a bookmark. ' );
43
43
}
44
44
45
45
/**
@@ -104,11 +104,11 @@ public function test_seek() {
104
104
* @covers set_bookmark
105
105
* @covers apply_attributes_updates
106
106
*/
107
- public function test_removing_long_attributes_doesnt_break_seek ( ) {
107
+ public function test_removing_long_attributes_doesnt_break_seek () {
108
108
$ input = <<<HTML
109
109
<button twenty_one_characters 7_chars></button><button></button>
110
110
HTML ;
111
- $ p = new WP_HTML_Tag_Processor ( $ input );
111
+ $ p = new WP_HTML_Tag_Processor ( $ input );
112
112
$ p ->next_tag ( 'button ' );
113
113
$ p ->set_bookmark ( 'first ' );
114
114
$ p ->next_tag ( 'button ' );
@@ -118,8 +118,8 @@ public function test_removing_long_attributes_doesnt_break_seek( ) {
118
118
$ p ->seek ( 'first ' ),
119
119
'Seek() to the first button has failed '
120
120
);
121
- $ p ->remove_attribute ('twenty_one_characters ' );
122
- $ p ->remove_attribute ('7_chars ' );
121
+ $ p ->remove_attribute ( 'twenty_one_characters ' );
122
+ $ p ->remove_attribute ( '7_chars ' );
123
123
124
124
$ this ->assertTrue (
125
125
$ p ->seek ( 'second ' ),
@@ -133,8 +133,8 @@ public function test_removing_long_attributes_doesnt_break_seek( ) {
133
133
* @covers seek
134
134
* @covers set_bookmark
135
135
*/
136
- public function test_bookmarks_complex_use_case ( ) {
137
- $ input = <<<HTML
136
+ public function test_bookmarks_complex_use_case () {
137
+ $ input = <<<HTML
138
138
<div selected class="merge-message" checked>
139
139
<div class="select-menu d-inline-block">
140
140
<div checked class="BtnGroup MixedCaseHTML position-relative" />
@@ -178,7 +178,7 @@ public function test_bookmarks_complex_use_case( ) {
178
178
</div>
179
179
</div>
180
180
HTML ;
181
- $ p = new WP_HTML_Tag_Processor ( $ input );
181
+ $ p = new WP_HTML_Tag_Processor ( $ input );
182
182
$ p ->next_tag ( 'div ' );
183
183
$ p ->next_tag ( 'div ' );
184
184
$ p ->next_tag ( 'div ' );
@@ -193,35 +193,35 @@ public function test_bookmarks_complex_use_case( ) {
193
193
$ p ->set_bookmark ( 'fourth button ' );
194
194
195
195
$ p ->seek ( 'first button ' );
196
- $ p ->set_attribute ('type ' , 'submit ' );
196
+ $ p ->set_attribute ( 'type ' , 'submit ' );
197
197
198
198
$ this ->assertTrue (
199
199
$ p ->seek ( 'third button ' ),
200
200
'Seek() to the third button failed '
201
201
);
202
- $ p ->remove_attribute ('class ' );
203
- $ p ->remove_attribute ('type ' );
204
- $ p ->remove_attribute ('aria-expanded ' );
205
- $ p ->set_attribute ('id ' , 'rebase-and-merge ' );
206
- $ p ->remove_attribute ('data-details-container ' );
202
+ $ p ->remove_attribute ( 'class ' );
203
+ $ p ->remove_attribute ( 'type ' );
204
+ $ p ->remove_attribute ( 'aria-expanded ' );
205
+ $ p ->set_attribute ( 'id ' , 'rebase-and-merge ' );
206
+ $ p ->remove_attribute ( 'data-details-container ' );
207
207
208
208
$ this ->assertTrue (
209
209
$ p ->seek ( 'first div ' ),
210
210
'Seek() to the first div failed '
211
211
);
212
- $ p ->set_attribute ('checked ' , false );
212
+ $ p ->set_attribute ( 'checked ' , false );
213
213
214
214
$ this ->assertTrue (
215
215
$ p ->seek ( 'fourth button ' ),
216
216
'Seek() to the fourth button failed '
217
217
);
218
- $ p ->set_attribute ('id ' , 'last-button ' );
219
- $ p ->remove_attribute ('class ' );
220
- $ p ->remove_attribute ('type ' );
221
- $ p ->remove_attribute ('checked ' );
222
- $ p ->remove_attribute ('aria-label ' );
223
- $ p ->remove_attribute ('disabled ' );
224
- $ p ->remove_attribute ('data-view-component ' );
218
+ $ p ->set_attribute ( 'id ' , 'last-button ' );
219
+ $ p ->remove_attribute ( 'class ' );
220
+ $ p ->remove_attribute ( 'type ' );
221
+ $ p ->remove_attribute ( 'checked ' );
222
+ $ p ->remove_attribute ( 'aria-label ' );
223
+ $ p ->remove_attribute ( 'disabled ' );
224
+ $ p ->remove_attribute ( 'data-view-component ' );
225
225
226
226
$ this ->assertTrue (
227
227
$ p ->seek ( 'second button ' ),
@@ -340,10 +340,10 @@ public function test_updates_bookmark_for_deletions_before_both_sides() {
340
340
public function test_limits_the_number_of_bookmarks () {
341
341
$ p = new WP_HTML_Tag_Processor ( '<ul><li>One</li><li>Two</li><li>Three</li></ul> ' );
342
342
$ p ->next_tag ( 'li ' );
343
- for ( $ i = 0 ;$ i< WP_HTML_Tag_Processor::MAX_BOOKMARKS ;$ i ++) {
343
+ for ( $ i = 0 ;$ i < WP_HTML_Tag_Processor::MAX_BOOKMARKS ;$ i ++ ) {
344
344
$ this ->assertTrue ( $ p ->set_bookmark ( "bookmark $ i " ), "Could not allocate the bookmark # $ i " );
345
345
}
346
- $ this ->assertFalse ( $ p ->set_bookmark ( " final bookmark " ), "Allocated $ i bookmarks, which is one above the limit. " );
346
+ $ this ->assertFalse ( $ p ->set_bookmark ( ' final bookmark ' ), "Allocated $ i bookmarks, which is one above the limit. " );
347
347
}
348
348
349
349
/**
@@ -354,12 +354,12 @@ public function test_limits_the_number_of_bookmarks() {
354
354
public function test_limits_the_number_of_seek_calls () {
355
355
$ p = new WP_HTML_Tag_Processor ( '<ul><li>One</li><li>Two</li><li>Three</li></ul> ' );
356
356
$ p ->next_tag ( 'li ' );
357
- $ p ->set_bookmark ('bookmark ' );
357
+ $ p ->set_bookmark ( 'bookmark ' );
358
358
359
- for ( $ i = 0 ;$ i< $ p ->seek_limit ();$ i ++) {
359
+ for ( $ i = 0 ;$ i < $ p ->seek_limit ();$ i ++ ) {
360
360
$ this ->assertTrue ( $ p ->seek ( 'bookmark ' ), 'Could not seek to the "bookmark" ' );
361
361
}
362
- $ this ->assertFalse ( $ p ->seek ( " bookmark " ), "$ i-th seek() to the bookmark succeeded, even though it should exceed the allowed limit. " );
362
+ $ this ->assertFalse ( $ p ->seek ( ' bookmark ' ), "$ i-th seek() to the bookmark succeeded, even though it should exceed the allowed limit. " );
363
363
}
364
364
/**
365
365
* @ticket 56299
@@ -368,13 +368,13 @@ public function test_limits_the_number_of_seek_calls() {
368
368
*/
369
369
public function test_adjusing_the_number_of_seek_calls () {
370
370
$ p = new WP_HTML_Tag_Processor ( '<ul><li>One</li><li>Two</li><li>Three</li></ul> ' );
371
- $ p ->seek_limit (2 );
371
+ $ p ->seek_limit ( 2 );
372
372
373
373
$ p ->next_tag ( 'li ' );
374
- $ p ->set_bookmark ('bookmark ' );
374
+ $ p ->set_bookmark ( 'bookmark ' );
375
375
$ this ->assertTrue ( $ p ->seek ( 'bookmark ' ), 'Could not seek to the "bookmark" ' );
376
376
$ this ->assertTrue ( $ p ->seek ( 'bookmark ' ), 'Could not seek to the "bookmark" ' );
377
- $ this ->assertFalse ( $ p ->seek ( " bookmark " ), " The third seek() to the bookmark succeeded, even though it should exceed the allowed limit. " );
377
+ $ this ->assertFalse ( $ p ->seek ( ' bookmark ' ), ' The third seek() to the bookmark succeeded, even though it should exceed the allowed limit. ' );
378
378
}
379
379
380
380
}
0 commit comments