Changeset 58594
- Timestamp:
- 06/28/2024 03:45:08 PM (5 months ago)
- Location:
- trunk/tests/phpunit/tests/interactivity-api
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-class.php
r58321 r58594 59 59 $html = '<div data-wp-class--some-class="myPlugin::state.true">Text</div>'; 60 60 list($p) = $this->process_directives( $html ); 61 $this->assert Equals( 'some-class', $p->get_attribute( 'class' ) );61 $this->assertSame( 'some-class', $p->get_attribute( 'class' ) ); 62 62 } 63 63 … … 77 77 >Text</div>'; 78 78 list($p) = $this->process_directives( $html ); 79 $this->assert Equals( 'some-class other-class', $p->get_attribute( 'class' ) );79 $this->assertSame( 'some-class other-class', $p->get_attribute( 'class' ) ); 80 80 } 81 81 … … 95 95 >Text</div>'; 96 96 list($p) = $this->process_directives( $html ); 97 $this->assert Equals( 'some-class', $p->get_attribute( 'class' ) );97 $this->assertSame( 'some-class', $p->get_attribute( 'class' ) ); 98 98 99 99 $html = ' … … 104 104 >Text</div>'; 105 105 list($p) = $this->process_directives( $html ); 106 $this->assert Equals( 'some-class', $p->get_attribute( 'class' ) );106 $this->assertSame( 'some-class', $p->get_attribute( 'class' ) ); 107 107 } 108 108 … … 117 117 $html = '<div class="other-class" data-wp-class--some-class="myPlugin::state.true">Text</div>'; 118 118 list($p) = $this->process_directives( $html ); 119 $this->assert Equals( 'other-class some-class', $p->get_attribute( 'class' ) );119 $this->assertSame( 'other-class some-class', $p->get_attribute( 'class' ) ); 120 120 } 121 121 … … 144 144 $html = '<div class="other-class" data-wp-class--some-class="myPlugin::state.false">Text</div>'; 145 145 list($p) = $this->process_directives( $html ); 146 $this->assert Equals( 'other-class', $p->get_attribute( 'class' ) );146 $this->assertSame( 'other-class', $p->get_attribute( 'class' ) ); 147 147 } 148 148 … … 158 158 $html = '<div class="some-class" data-wp-class--some-class="myPlugin::state.true">Text</div>'; 159 159 list($p) = $this->process_directives( $html ); 160 $this->assert Equals( 'some-class', $p->get_attribute( 'class' ) );160 $this->assertSame( 'some-class', $p->get_attribute( 'class' ) ); 161 161 } 162 162 … … 172 172 $html = '<div class="other-class some-class" data-wp-class--some-class="myPlugin::state.true">Text</div>'; 173 173 list($p) = $this->process_directives( $html ); 174 $this->assert Equals( 'other-class some-class', $p->get_attribute( 'class' ) );174 $this->assertSame( 'other-class some-class', $p->get_attribute( 'class' ) ); 175 175 } 176 176 … … 200 200 $html = '<div class="other-class some-class" data-wp-class--some-class="myPlugin::state.false">Text</div>'; 201 201 list($p) = $this->process_directives( $html ); 202 $this->assert Equals( 'other-class', $p->get_attribute( 'class' ) );202 $this->assertSame( 'other-class', $p->get_attribute( 'class' ) ); 203 203 } 204 204 … … 228 228 $html = '<div class="other-class" data-wp-class="myPlugin::state.true">Text</div>'; 229 229 list($p) = $this->process_directives( $html ); 230 $this->assert Equals( 'other-class', $p->get_attribute( 'class' ) );230 $this->assertSame( 'other-class', $p->get_attribute( 'class' ) ); 231 231 } 232 232 … … 243 243 $html = '<div class="other-class" data-wp-class--some-class="">Text</div>'; 244 244 list($p) = $this->process_directives( $html ); 245 $this->assert Equals( 'other-class', $p->get_attribute( 'class' ) );245 $this->assertSame( 'other-class', $p->get_attribute( 'class' ) ); 246 246 } 247 247 … … 258 258 $html = '<div class="other-class" data-wp-class--some-class>Text</div>'; 259 259 list($p) = $this->process_directives( $html ); 260 $this->assert Equals( 'other-class', $p->get_attribute( 'class' ) );260 $this->assertSame( 'other-class', $p->get_attribute( 'class' ) ); 261 261 } 262 262 … … 272 272 $html = '<div data-wp-class--some-class="myPlugin::state.true" data-wp-class--some-class="myPlugin::state.true">Text</div>'; 273 273 list($p) = $this->process_directives( $html ); 274 $this->assert Equals( 'some-class', $p->get_attribute( 'class' ) );274 $this->assertSame( 'some-class', $p->get_attribute( 'class' ) ); 275 275 } 276 276 … … 287 287 $html = '<div data-wp-class--some-class="myPlugin::state.text">Text</div>'; 288 288 list($p) = $this->process_directives( $html ); 289 $this->assert Equals( 'some-class', $p->get_attribute( 'class' ) );289 $this->assertSame( 'some-class', $p->get_attribute( 'class' ) ); 290 290 291 291 $this->interactivity->state( 'myPlugin', array( 'array' => array( 1, 2 ) ) ); 292 292 $html = '<div data-wp-class--some-class="myPlugin::state.array">Text</div>'; 293 293 list($p) = $this->process_directives( $html ); 294 $this->assert Equals( 'some-class', $p->get_attribute( 'class' ) );294 $this->assertSame( 'some-class', $p->get_attribute( 'class' ) ); 295 295 296 296 $this->interactivity->state( 'myPlugin', array( 'number' => 1 ) ); 297 297 $html = '<div data-wp-class--some-class="myPlugin::state.number">Text</div>'; 298 298 list($p) = $this->process_directives( $html ); 299 $this->assert Equals( 'some-class', $p->get_attribute( 'class' ) );299 $this->assertSame( 'some-class', $p->get_attribute( 'class' ) ); 300 300 } 301 301 -
trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-context.php
r58321 r58594 57 57 '; 58 58 list($p) = $this->process_directives( $html ); 59 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );59 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 60 60 } 61 61 … … 79 79 '; 80 80 list($p) = $this->process_directives( $html ); 81 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );81 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 82 82 } 83 83 … … 100 100 '; 101 101 list($p) = $this->process_directives( $html ); 102 $this->assert Equals( 'some-id-1', $p->get_attribute( 'id' ) );103 $p->next_tag( array( 'class_name' => 'test' ) ); 104 $this->assert Equals( 'some-id-2', $p->get_attribute( 'id' ) );102 $this->assertSame( 'some-id-1', $p->get_attribute( 'id' ) ); 103 $p->next_tag( array( 'class_name' => 'test' ) ); 104 $this->assertSame( 'some-id-2', $p->get_attribute( 'id' ) ); 105 105 } 106 106 … … 122 122 '; 123 123 list($p) = $this->process_directives( $html ); 124 $this->assert Equals( 'some-id-2', $p->get_attribute( 'id' ) );124 $this->assertSame( 'some-id-2', $p->get_attribute( 'id' ) ); 125 125 } 126 126 … … 143 143 '; 144 144 list($p) = $this->process_directives( $html ); 145 $this->assert Equals( 'some-id-2', $p->get_attribute( 'id' ) );146 $p->next_tag( array( 'class_name' => 'test' ) ); 147 $this->assert Equals( 'some-id-1', $p->get_attribute( 'id' ) );145 $this->assertSame( 'some-id-2', $p->get_attribute( 'id' ) ); 146 $p->next_tag( array( 'class_name' => 'test' ) ); 147 $this->assertSame( 'some-id-1', $p->get_attribute( 'id' ) ); 148 148 } 149 149 … … 166 166 '; 167 167 list($p) = $this->process_directives( $html ); 168 $this->assert Equals( 'some-id-1', $p->get_attribute( 'id' ) );169 $p->next_tag( array( 'class_name' => 'test' ) ); 170 $this->assert Equals( 'some-id-2', $p->get_attribute( 'id' ) );168 $this->assertSame( 'some-id-1', $p->get_attribute( 'id' ) ); 169 $p->next_tag( array( 'class_name' => 'test' ) ); 170 $this->assertSame( 'some-id-2', $p->get_attribute( 'id' ) ); 171 171 } 172 172 … … 207 207 '; 208 208 list($p) = $this->process_directives( $html ); 209 $this->assert Equals( 'some-id-1', $p->get_attribute( 'id' ) );210 $p->next_tag( array( 'class_name' => 'test' ) ); 211 $this->assert Equals( 'some-id-1', $p->get_attribute( 'id' ) );209 $this->assertSame( 'some-id-1', $p->get_attribute( 'id' ) ); 210 $p->next_tag( array( 'class_name' => 'test' ) ); 211 $this->assertSame( 'some-id-1', $p->get_attribute( 'id' ) ); 212 212 } 213 213 … … 248 248 '; 249 249 list($p) = $this->process_directives( $html ); 250 $this->assert Equals( 'some-id-1', $p->get_attribute( 'id' ) );251 $p->next_tag( array( 'class_name' => 'test' ) ); 252 $this->assert Equals( 'some-id-1', $p->get_attribute( 'id' ) );250 $this->assertSame( 'some-id-1', $p->get_attribute( 'id' ) ); 251 $p->next_tag( array( 'class_name' => 'test' ) ); 252 $this->assertSame( 'some-id-1', $p->get_attribute( 'id' ) ); 253 253 } 254 254 … … 289 289 '; 290 290 list($p) = $this->process_directives( $html ); 291 $this->assert Equals( 'some-id-1', $p->get_attribute( 'id' ) );292 $p->next_tag( array( 'class_name' => 'test' ) ); 293 $this->assert Equals( 'some-id-1', $p->get_attribute( 'id' ) );291 $this->assertSame( 'some-id-1', $p->get_attribute( 'id' ) ); 292 $p->next_tag( array( 'class_name' => 'test' ) ); 293 $this->assertSame( 'some-id-1', $p->get_attribute( 'id' ) ); 294 294 } 295 295 … … 308 308 '; 309 309 list($p) = $this->process_directives( $html ); 310 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );310 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 311 311 } 312 312 … … 347 347 '; 348 348 list($p) = $this->process_directives( $html ); 349 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );349 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 350 350 } 351 351 … … 369 369 '; 370 370 list($p) = $this->process_directives( $html ); 371 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );371 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 372 372 } 373 373 … … 390 390 '; 391 391 list($p) = $this->process_directives( $html ); 392 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );392 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 393 393 } 394 394 … … 417 417 '; 418 418 list($p) = $this->process_directives( $html ); 419 $this->assert Equals( 'other-id', $p->get_attribute( 'id' ) );420 $p->next_tag( array( 'class_name' => 'test' ) ); 421 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );422 $p->next_tag( array( 'class_name' => 'test' ) ); 423 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );419 $this->assertSame( 'other-id', $p->get_attribute( 'id' ) ); 420 $p->next_tag( array( 'class_name' => 'test' ) ); 421 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 422 $p->next_tag( array( 'class_name' => 'test' ) ); 423 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 424 424 $p->next_tag( array( 'class_name' => 'test' ) ); 425 425 $this->assertNull( $p->get_attribute( 'id' ) ); … … 446 446 '; 447 447 list($p) = $this->process_directives( $html ); 448 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );448 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 449 449 } 450 450 … … 470 470 '; 471 471 list($p) = $this->process_directives( $html ); 472 $this->assert Equals( 'some-id-1', $p->get_attribute( 'id' ) );473 $p->next_tag( array( 'class_name' => 'test' ) ); 474 $this->assert Equals( 'some-id-2', $p->get_attribute( 'id' ) );472 $this->assertSame( 'some-id-1', $p->get_attribute( 'id' ) ); 473 $p->next_tag( array( 'class_name' => 'test' ) ); 474 $this->assertSame( 'some-id-2', $p->get_attribute( 'id' ) ); 475 475 } 476 476 … … 495 495 '; 496 496 list($p) = $this->process_directives( $html ); 497 $this->assert Equals( 'some-id-2', $p->get_attribute( 'id' ) );497 $this->assertSame( 'some-id-2', $p->get_attribute( 'id' ) ); 498 498 } 499 499 … … 519 519 '; 520 520 list($p) = $this->process_directives( $html ); 521 $this->assert Equals( 'some-id-2', $p->get_attribute( 'id' ) );522 $p->next_tag( array( 'class_name' => 'test' ) ); 523 $this->assert Equals( 'some-id-1', $p->get_attribute( 'id' ) );521 $this->assertSame( 'some-id-2', $p->get_attribute( 'id' ) ); 522 $p->next_tag( array( 'class_name' => 'test' ) ); 523 $this->assertSame( 'some-id-1', $p->get_attribute( 'id' ) ); 524 524 } 525 525 } -
trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-each.php
r58327 r58594 43 43 </div>'; 44 44 $new = $this->interactivity->process_directives( $original ); 45 $this->assert Equals( $original, $new );45 $this->assertSame( $original, $new ); 46 46 } 47 47 … … 69 69 </template>'; 70 70 $new = $this->interactivity->process_directives( $original ); 71 $this->assert Equals( $original, $new );71 $this->assertSame( $original, $new ); 72 72 } 73 73 … … 93 93 '<div id="after-wp-each" data-wp-bind--id="myPlugin::state.after">Text</div>'; 94 94 $new = $this->interactivity->process_directives( $original ); 95 $this->assert Equals( $expected, $new );95 $this->assertSame( $expected, $new ); 96 96 } 97 97 … … 117 117 '<div id="after-wp-each" data-wp-bind--id="myPlugin::state.after">Text</div>'; 118 118 $new = $this->interactivity->process_directives( $original ); 119 $this->assert Equals( $expected, $new );119 $this->assertSame( $expected, $new ); 120 120 } 121 121 … … 146 146 '</div>'; 147 147 $new = $this->interactivity->process_directives( $original ); 148 $this->assert Equals( $expected, $new );148 $this->assertSame( $expected, $new ); 149 149 } 150 150 … … 174 174 '</div>'; 175 175 $new = $this->interactivity->process_directives( $original ); 176 $this->assert Equals( $expected, $new );176 $this->assertSame( $expected, $new ); 177 177 } 178 178 … … 202 202 '</div>'; 203 203 $new = $this->interactivity->process_directives( $original ); 204 $this->assert Equals( $expected, $new );204 $this->assertSame( $expected, $new ); 205 205 } 206 206 … … 230 230 '<div id="after-wp-each" data-wp-bind--id="myPlugin::state.after">Text</div>'; 231 231 $new = $this->interactivity->process_directives( $original ); 232 $this->assert Equals( $expected, $new );232 $this->assertSame( $expected, $new ); 233 233 } 234 234 … … 258 258 '<div id="after-wp-each" data-wp-bind--id="myPlugin::state.after">Text</div>'; 259 259 $new = $this->interactivity->process_directives( $original ); 260 $this->assert Equals( $expected, $new );260 $this->assertSame( $expected, $new ); 261 261 } 262 262 … … 287 287 '<div id="after-wp-each" data-wp-bind--id="myPlugin::state.after">Text</div>'; 288 288 $new = $this->interactivity->process_directives( $original ); 289 $this->assert Equals( $expected, $new );289 $this->assertSame( $expected, $new ); 290 290 } 291 291 … … 319 319 '<div id="after-wp-each" data-wp-bind--id="myPlugin::state.after">Text</div>'; 320 320 $new = $this->interactivity->process_directives( $original ); 321 $this->assert Equals( $expected, $new );321 $this->assertSame( $expected, $new ); 322 322 } 323 323 … … 362 362 '<div id="after-wp-each" data-wp-bind--id="myPlugin::state.after">Text</div>'; 363 363 $new = $this->interactivity->process_directives( $original ); 364 $this->assert Equals( $expected, $new );364 $this->assertSame( $expected, $new ); 365 365 } 366 366 … … 386 386 '<div id="after-wp-each" data-wp-bind--id="myPlugin::state.after">Text</div>'; 387 387 $new = $this->interactivity->process_directives( $original ); 388 $this->assert Equals( $expected, $new );388 $this->assertSame( $expected, $new ); 389 389 } 390 390 … … 411 411 '<div id="after-wp-each" data-wp-bind--id="myPlugin::state.after">Text</div>'; 412 412 $new = $this->interactivity->process_directives( $original ); 413 $this->assert Equals( $expected, $new );413 $this->assertSame( $expected, $new ); 414 414 } 415 415 … … 427 427 '</template>'; 428 428 $new = $this->interactivity->process_directives( $original ); 429 $this->assert Equals( $original, $new );429 $this->assertSame( $original, $new ); 430 430 431 431 $original = '' . … … 434 434 '</template>'; 435 435 $new = $this->interactivity->process_directives( $original ); 436 $this->assert Equals( $original, $new );436 $this->assertSame( $original, $new ); 437 437 438 438 // But it should work fine with spaces and linebreaks. … … 445 445 $p->next_tag( array( 'class_name' => 'test' ) ); 446 446 $p->next_tag( array( 'class_name' => 'test' ) ); 447 $this->assert Equals( '1', $p->get_attribute( 'id' ) );447 $this->assertSame( '1', $p->get_attribute( 'id' ) ); 448 448 $p->next_tag( array( 'class_name' => 'test' ) ); 449 $this->assert Equals( '2', $p->get_attribute( 'id' ) );449 $this->assertSame( '2', $p->get_attribute( 'id' ) ); 450 450 } 451 451 … … 488 488 '<div id="after-wp-each" data-wp-bind--id="myPlugin::state.after">Text</div>'; 489 489 $new = $this->interactivity->process_directives( $original ); 490 $this->assert Equals( $expected, $new );490 $this->assertSame( $expected, $new ); 491 491 } 492 492 … … 534 534 '<div id="after-wp-each" data-wp-bind--id="myPlugin::state.after">Text</div>'; 535 535 $new = $this->interactivity->process_directives( $original ); 536 $this->assert Equals( $expected, $new );536 $this->assertSame( $expected, $new ); 537 537 } 538 538 … … 572 572 '<div id="after-wp-each" data-wp-bind--id="myPlugin::state.after">Text</div>'; 573 573 $new = $this->interactivity->process_directives( $original ); 574 $this->assert Equals( $expected, $new );574 $this->assertSame( $expected, $new ); 575 575 } 576 576 … … 591 591 '<div data-wp-bind--id="myPlugin::state.after">Text</div>'; 592 592 $new = $this->interactivity->process_directives( $original ); 593 $this->assert Equals( $original, $new );593 $this->assertSame( $original, $new ); 594 594 } 595 595 … … 615 615 '<div data-wp-bind--id="myPlugin::state.after">Text</div>'; 616 616 $new = $this->interactivity->process_directives( $original ); 617 $this->assert Equals( $original, $new );617 $this->assertSame( $original, $new ); 618 618 } 619 619 … … 640 640 $this->interactivity->state( 'myPlugin', array( 'list' => null ) ); 641 641 $new = $this->interactivity->process_directives( $original ); 642 $this->assert Equals( $expected, $new );642 $this->assertSame( $expected, $new ); 643 643 644 644 $this->interactivity->state( 'myPlugin', array( 'list' => 'Text' ) ); 645 645 $new = $this->interactivity->process_directives( $original ); 646 $this->assert Equals( $expected, $new );646 $this->assertSame( $expected, $new ); 647 647 648 648 $this->interactivity->state( 'myPlugin', array( 'list' => 100 ) ); 649 649 $new = $this->interactivity->process_directives( $original ); 650 $this->assert Equals( $expected, $new );650 $this->assertSame( $expected, $new ); 651 651 652 652 $this->interactivity->state( 'myPlugin', array( 'list' => false ) ); 653 653 $new = $this->interactivity->process_directives( $original ); 654 $this->assert Equals( $expected, $new );654 $this->assertSame( $expected, $new ); 655 655 656 656 $this->interactivity->state( 'myPlugin', array( 'list' => true ) ); 657 657 $new = $this->interactivity->process_directives( $original ); 658 $this->assert Equals( $expected, $new );658 $this->assertSame( $expected, $new ); 659 659 } 660 660 … … 683 683 '<div id="after-wp-each" data-wp-bind--id="myPlugin::state.after">Text</div>'; 684 684 $new = $this->interactivity->process_directives( $original ); 685 $this->assert Equals( $expected, $new );685 $this->assertSame( $expected, $new ); 686 686 } 687 687 } -
trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-interactive.php
r57836 r58594 59 59 '; 60 60 list($p) = $this->process_directives( $html ); 61 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );61 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 62 62 } 63 63 … … 77 77 '; 78 78 list($p) = $this->process_directives( $html ); 79 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );79 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 80 80 } 81 81 … … 98 98 '; 99 99 list($p) = $this->process_directives( $html ); 100 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );101 $p->next_tag( array( 'class_name' => 'test' ) ); 102 $this->assert Equals( 'other-id', $p->get_attribute( 'id' ) );100 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 101 $p->next_tag( array( 'class_name' => 'test' ) ); 102 $this->assertSame( 'other-id', $p->get_attribute( 'id' ) ); 103 103 } 104 104 … … 122 122 '; 123 123 list($p) = $this->process_directives( $html ); 124 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );125 $p->next_tag( array( 'class_name' => 'test' ) ); 126 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );124 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 125 $p->next_tag( array( 'class_name' => 'test' ) ); 126 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 127 127 } 128 128 … … 145 145 '; 146 146 list($p) = $this->process_directives( $html ); 147 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );148 $p->next_tag( array( 'class_name' => 'test' ) ); 149 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );147 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 148 $p->next_tag( array( 'class_name' => 'test' ) ); 149 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 150 150 } 151 151 … … 168 168 '; 169 169 list($p) = $this->process_directives( $html ); 170 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );171 $p->next_tag( array( 'class_name' => 'test' ) ); 172 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );170 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 171 $p->next_tag( array( 'class_name' => 'test' ) ); 172 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 173 173 } 174 174 … … 191 191 '; 192 192 list($p) = $this->process_directives( $html ); 193 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );194 $p->next_tag( array( 'class_name' => 'test' ) ); 195 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );193 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 194 $p->next_tag( array( 'class_name' => 'test' ) ); 195 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 196 196 } 197 197 … … 210 210 '; 211 211 list($p) = $this->process_directives( $html ); 212 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );212 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 213 213 } 214 214 … … 228 228 '; 229 229 list($p) = $this->process_directives( $html ); 230 $this->assert Equals( 'other-id', $p->get_attribute( 'id' ) );230 $this->assertSame( 'other-id', $p->get_attribute( 'id' ) ); 231 231 } 232 232 … … 249 249 '; 250 250 list($p) = $this->process_directives( $html ); 251 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );252 $p->next_tag( array( 'class_name' => 'test' ) ); 253 $this->assert Equals( 'other-id', $p->get_attribute( 'id' ) );251 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 252 $p->next_tag( array( 'class_name' => 'test' ) ); 253 $this->assertSame( 'other-id', $p->get_attribute( 'id' ) ); 254 254 255 255 $html = ' … … 262 262 '; 263 263 list($p) = $this->process_directives( $html ); 264 $this->assert Equals( 'other-id', $p->get_attribute( 'id' ) );265 $p->next_tag( array( 'class_name' => 'test' ) ); 266 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );264 $this->assertSame( 'other-id', $p->get_attribute( 'id' ) ); 265 $p->next_tag( array( 'class_name' => 'test' ) ); 266 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 267 267 } 268 268 } -
trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-router-region.php
r57836 r58594 89 89 $new_html = $this->interactivity->process_directives( $html ); 90 90 $footer = $this->render_wp_footer(); 91 $this->assert Equals( $html, $new_html );92 $this->assert Equals( '', $footer );93 $this->assert Equals( '', get_echo( 'wp_print_styles' ) );91 $this->assertSame( $html, $new_html ); 92 $this->assertSame( '', $footer ); 93 $this->assertSame( '', get_echo( 'wp_print_styles' ) ); 94 94 } 95 95 … … 109 109 '; 110 110 $new_html = $this->interactivity->process_directives( $html ); 111 $this->assert Equals( $html, $new_html );111 $this->assertSame( $html, $new_html ); 112 112 113 113 // Check that the style is loaded, but only once. … … 116 116 $p = new WP_HTML_Tag_Processor( $styles ); 117 117 $this->assertTrue( $p->next_tag( $query ) ); 118 $this->assert Equals( 'wp-interactivity-router-animations-inline-css', $p->get_attribute( 'id' ) );118 $this->assertSame( 'wp-interactivity-router-animations-inline-css', $p->get_attribute( 'id' ) ); 119 119 $this->assertStringContainsString( '.wp-interactivity-router-loading-bar', $styles ); 120 120 $this->assertFalse( $p->next_tag( $query ) ); -
trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-style.php
r58321 r58594 62 62 // Adds property on empty style attribute. 63 63 $result = $this->merge_style_property( '', 'color', 'green' ); 64 $this->assert Equals( 'color:green;', $result );64 $this->assertSame( 'color:green;', $result ); 65 65 66 66 // Changes style property when there is an existing property. 67 67 $result = $this->merge_style_property( 'color:red;', 'color', 'green' ); 68 $this->assert Equals( 'color:green;', $result );68 $this->assertSame( 'color:green;', $result ); 69 69 70 70 // Adds a new property when the existing one does not match. 71 71 $result = $this->merge_style_property( 'color:red;', 'background', 'blue' ); 72 $this->assert Equals( 'color:red;background:blue;', $result );72 $this->assertSame( 'color:red;background:blue;', $result ); 73 73 74 74 // Handles multiple existing properties. 75 75 $result = $this->merge_style_property( 'color:red;margin:5px;', 'color', 'green' ); 76 $this->assert Equals( 'margin:5px;color:green;', $result );76 $this->assertSame( 'margin:5px;color:green;', $result ); 77 77 78 78 // Adds a new property when multiple existing properties do not match. 79 79 $result = $this->merge_style_property( 'color:red;margin:5px;', 'padding', '10px' ); 80 $this->assert Equals( 'color:red;margin:5px;padding:10px;', $result );80 $this->assertSame( 'color:red;margin:5px;padding:10px;', $result ); 81 81 82 82 // Removes whitespaces in all properties. 83 83 $result = $this->merge_style_property( ' color : red; margin : 5px; ', 'padding', ' 10px ' ); 84 $this->assert Equals( 'color:red;margin:5px;padding:10px;', $result );84 $this->assertSame( 'color:red;margin:5px;padding:10px;', $result ); 85 85 86 86 // Updates a property when it's not the first one in the value. 87 87 $result = $this->merge_style_property( 'color:red;margin:5px;', 'margin', '15px' ); 88 $this->assert Equals( 'color:red;margin:15px;', $result );88 $this->assertSame( 'color:red;margin:15px;', $result ); 89 89 90 90 // Adds missing trailing semicolon. 91 91 $result = $this->merge_style_property( 'color:red;margin:5px', 'padding', '10px' ); 92 $this->assert Equals( 'color:red;margin:5px;padding:10px;', $result );92 $this->assertSame( 'color:red;margin:5px;padding:10px;', $result ); 93 93 94 94 // Doesn't add double semicolons. 95 95 $result = $this->merge_style_property( 'color:red;margin:5px;', 'padding', '10px;' ); 96 $this->assert Equals( 'color:red;margin:5px;padding:10px;', $result );96 $this->assertSame( 'color:red;margin:5px;padding:10px;', $result ); 97 97 98 98 // Handles empty properties in the input. 99 99 $result = $this->merge_style_property( 'color:red;;margin:5px;;', 'padding', '10px' ); 100 $this->assert Equals( 'color:red;margin:5px;padding:10px;', $result );100 $this->assertSame( 'color:red;margin:5px;padding:10px;', $result ); 101 101 102 102 // Moves the modified property to the end. 103 103 $result = $this->merge_style_property( 'border-style: dashed; border: 3px solid red;', 'border-style', 'inset' ); 104 $this->assert Equals( 'border:3px solid red;border-style:inset;', $result );104 $this->assertSame( 'border:3px solid red;border-style:inset;', $result ); 105 105 } 106 106 … … 116 116 // Removes a property with an empty string. 117 117 $result = $this->merge_style_property( 'color:red;margin:5px;', 'color', '' ); 118 $this->assert Equals( 'margin:5px;', $result );118 $this->assertSame( 'margin:5px;', $result ); 119 119 120 120 // Removes a property with null. 121 121 $result = $this->merge_style_property( 'color:red;margin:5px;', 'color', null ); 122 $this->assert Equals( 'margin:5px;', $result );122 $this->assertSame( 'margin:5px;', $result ); 123 123 124 124 // Removes a property with false. 125 125 $result = $this->merge_style_property( 'color:red;margin:5px;', 'color', false ); 126 $this->assert Equals( 'margin:5px;', $result );126 $this->assertSame( 'margin:5px;', $result ); 127 127 128 128 // Removes a property with 0. 129 129 $result = $this->merge_style_property( 'color:red;margin:5px;', 'color', 0 ); 130 $this->assert Equals( 'margin:5px;', $result );130 $this->assertSame( 'margin:5px;', $result ); 131 131 132 132 // It doesn't add a new property with an empty string. 133 133 $result = $this->merge_style_property( 'color:red;', 'padding', '' ); 134 $this->assert Equals( 'color:red;', $result );134 $this->assertSame( 'color:red;', $result ); 135 135 136 136 // It doesn't add a new property with null. 137 137 $result = $this->merge_style_property( 'color:red;', 'padding', null ); 138 $this->assert Equals( 'color:red;', $result );138 $this->assertSame( 'color:red;', $result ); 139 139 140 140 // It doesn't add a new property with false. 141 141 $result = $this->merge_style_property( 'color:red;', 'padding', false ); 142 $this->assert Equals( 'color:red;', $result );142 $this->assertSame( 'color:red;', $result ); 143 143 144 144 // It doesn't add a new property with 0. 145 145 $result = $this->merge_style_property( 'color:red;', 'padding', 0 ); 146 $this->assert Equals( 'color:red;', $result );146 $this->assertSame( 'color:red;', $result ); 147 147 } 148 148 … … 171 171 $html = '<div data-wp-style--color="myPlugin::state.green">Text</div>'; 172 172 list($p) = $this->process_directives( $html ); 173 $this->assert Equals( 'color:green;', $p->get_attribute( 'style' ) );173 $this->assertSame( 'color:green;', $p->get_attribute( 'style' ) ); 174 174 } 175 175 … … 189 189 >Text</div>'; 190 190 list($p) = $this->process_directives( $html ); 191 $this->assert Equals( 'color:green;background:green;', $p->get_attribute( 'style' ) );191 $this->assertSame( 'color:green;background:green;', $p->get_attribute( 'style' ) ); 192 192 } 193 193 … … 207 207 >Text</div>'; 208 208 list($p) = $this->process_directives( $html ); 209 $this->assert Equals( 'color:green;', $p->get_attribute( 'style' ) );209 $this->assertSame( 'color:green;', $p->get_attribute( 'style' ) ); 210 210 211 211 $html = ' … … 216 216 >Text</div>'; 217 217 list($p) = $this->process_directives( $html ); 218 $this->assert Equals( 'color:green;', $p->get_attribute( 'style' ) );218 $this->assertSame( 'color:green;', $p->get_attribute( 'style' ) ); 219 219 } 220 220 … … 230 230 $html = '<div style="padding:10px;" data-wp-style--color="myPlugin::state.green">Text</div>'; 231 231 list($p) = $this->process_directives( $html ); 232 $this->assert Equals( 'padding:10px;color:green;', $p->get_attribute( 'style' ) );232 $this->assertSame( 'padding:10px;color:green;', $p->get_attribute( 'style' ) ); 233 233 } 234 234 … … 244 244 $html = '<div style="color:red;" data-wp-style--color="myPlugin::state.green">Text</div>'; 245 245 list($p) = $this->process_directives( $html ); 246 $this->assert Equals( 'color:green;', $p->get_attribute( 'style' ) );246 $this->assertSame( 'color:green;', $p->get_attribute( 'style' ) ); 247 247 } 248 248 … … 272 272 $html = '<div style="padding:10px;" data-wp-style--color="myPlugin::state.false">Text</div>'; 273 273 list($p) = $this->process_directives( $html ); 274 $this->assert Equals( 'padding:10px;', $p->get_attribute( 'style' ) );274 $this->assertSame( 'padding:10px;', $p->get_attribute( 'style' ) ); 275 275 } 276 276 … … 286 286 $html = '<div style="color:green;" data-wp-style--color="myPlugin::state.green">Text</div>'; 287 287 list($p) = $this->process_directives( $html ); 288 $this->assert Equals( 'color:green;', $p->get_attribute( 'style' ) );288 $this->assertSame( 'color:green;', $p->get_attribute( 'style' ) ); 289 289 } 290 290 … … 300 300 $html = '<div style="padding:10px;color:green;" data-wp-style--color="myPlugin::state.green">Text</div>'; 301 301 list($p) = $this->process_directives( $html ); 302 $this->assert Equals( 'padding:10px;color:green;', $p->get_attribute( 'style' ) );302 $this->assertSame( 'padding:10px;color:green;', $p->get_attribute( 'style' ) ); 303 303 } 304 304 … … 328 328 $html = '<div style="padding:10px;color:green;" data-wp-style--color="myPlugin::state.false">Text</div>'; 329 329 list($p) = $this->process_directives( $html ); 330 $this->assert Equals( 'padding:10px;', $p->get_attribute( 'style' ) );330 $this->assertSame( 'padding:10px;', $p->get_attribute( 'style' ) ); 331 331 } 332 332 … … 356 356 $html = '<div style="padding:10px;" data-wp-style="myPlugin::state.green">Text</div>'; 357 357 list($p) = $this->process_directives( $html ); 358 $this->assert Equals( 'padding:10px;', $p->get_attribute( 'style' ) );358 $this->assertSame( 'padding:10px;', $p->get_attribute( 'style' ) ); 359 359 } 360 360 … … 371 371 $html = '<div style="padding:10px" data-wp-style--color="">Text</div>'; 372 372 list($p) = $this->process_directives( $html ); 373 $this->assert Equals( 'padding:10px;', $p->get_attribute( 'style' ) );373 $this->assertSame( 'padding:10px;', $p->get_attribute( 'style' ) ); 374 374 } 375 375 … … 386 386 $html = '<div style="padding: 10px;" data-wp-style--color>Text</div>'; 387 387 list($p) = $this->process_directives( $html ); 388 $this->assert Equals( 'padding:10px;', $p->get_attribute( 'style' ) );388 $this->assertSame( 'padding:10px;', $p->get_attribute( 'style' ) ); 389 389 } 390 390 … … 400 400 $html = '<div data-wp-style--color="myPlugin::state.green" data-wp-style--color="myPlugin::state.green">Text</div>'; 401 401 list($p) = $this->process_directives( $html ); 402 $this->assert Equals( 'color:green;', $p->get_attribute( 'style' ) );402 $this->assertSame( 'color:green;', $p->get_attribute( 'style' ) ); 403 403 } 404 404 -
trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPI-wp-text.php
r58327 r58594 40 40 $html = '<div data-wp-text="myPlugin::state.text">Text</div>'; 41 41 $new_html = $this->interactivity->process_directives( $html ); 42 $this->assert Equals( '<div data-wp-text="myPlugin::state.text">Updated</div>', $new_html );42 $this->assertSame( '<div data-wp-text="myPlugin::state.text">Updated</div>', $new_html ); 43 43 } 44 44 … … 54 54 $html = '<div data-wp-text="myPlugin::state.number">Text</div>'; 55 55 $new_html = $this->interactivity->process_directives( $html ); 56 $this->assert Equals( '<div data-wp-text="myPlugin::state.number">100</div>', $new_html );56 $this->assertSame( '<div data-wp-text="myPlugin::state.number">100</div>', $new_html ); 57 57 } 58 58 … … 78 78 $html = '<div data-wp-text="myPlugin::state.true">Text</div>'; 79 79 $new_html = $this->interactivity->process_directives( $html ); 80 $this->assert Equals( '<div data-wp-text="myPlugin::state.true"></div>', $new_html );80 $this->assertSame( '<div data-wp-text="myPlugin::state.true"></div>', $new_html ); 81 81 82 82 $html = '<div data-wp-text="myPlugin::state.false">Text</div>'; 83 83 $new_html = $this->interactivity->process_directives( $html ); 84 $this->assert Equals( '<div data-wp-text="myPlugin::state.false"></div>', $new_html );84 $this->assertSame( '<div data-wp-text="myPlugin::state.false"></div>', $new_html ); 85 85 86 86 $html = '<div data-wp-text="myPlugin::state.null">Text</div>'; 87 87 $new_html = $this->interactivity->process_directives( $html ); 88 $this->assert Equals( '<div data-wp-text="myPlugin::state.null"></div>', $new_html );88 $this->assertSame( '<div data-wp-text="myPlugin::state.null"></div>', $new_html ); 89 89 90 90 $html = '<div data-wp-text="myPlugin::state.array">Text</div>'; 91 91 $new_html = $this->interactivity->process_directives( $html ); 92 $this->assert Equals( '<div data-wp-text="myPlugin::state.array"></div>', $new_html );92 $this->assertSame( '<div data-wp-text="myPlugin::state.array"></div>', $new_html ); 93 93 94 94 $html = '<div data-wp-text="myPlugin::state.func">Text</div>'; 95 95 $new_html = $this->interactivity->process_directives( $html ); 96 $this->assert Equals( '<div data-wp-text="myPlugin::state.func"></div>', $new_html );96 $this->assertSame( '<div data-wp-text="myPlugin::state.func"></div>', $new_html ); 97 97 } 98 98 … … 108 108 $html = '<div data-wp-text="myPlugin::state.text"><div><div>Text</div><div>Another text</div></div></div>'; 109 109 $new_html = $this->interactivity->process_directives( $html ); 110 $this->assert Equals( '<div data-wp-text="myPlugin::state.text">Updated</div>', $new_html );110 $this->assertSame( '<div data-wp-text="myPlugin::state.text">Updated</div>', $new_html ); 111 111 } 112 112 … … 122 122 $html = '<div data-wp-text="myPlugin::state.text"><span>Text</div>'; 123 123 $new_html = $this->interactivity->process_directives( $html ); 124 $this->assert Equals( '<div data-wp-text="myPlugin::state.text">Updated</div>', $new_html );124 $this->assertSame( '<div data-wp-text="myPlugin::state.text">Updated</div>', $new_html ); 125 125 } 126 126 … … 138 138 $html = '<div data-wp-text="myPlugin::state.text">Text<div></div>'; 139 139 $new_html = $this->interactivity->process_directives( $html ); 140 $this->assert Equals( '<div data-wp-text="myPlugin::state.text">Text<div></div>', $new_html );140 $this->assertSame( '<div data-wp-text="myPlugin::state.text">Text<div></div>', $new_html ); 141 141 } 142 142 … … 153 153 $html = '<div data-wp-text="myPlugin::state.text">Text</div>'; 154 154 $new_html = $this->interactivity->process_directives( $html ); 155 $this->assert Equals( '<div data-wp-text="myPlugin::state.text"><span>Updated</span></div>', $new_html );155 $this->assertSame( '<div data-wp-text="myPlugin::state.text"><span>Updated</span></div>', $new_html ); 156 156 } 157 157 } -
trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPI.php
r58327 r58594 70 70 */ 71 71 public function test_state_and_config_should_be_empty() { 72 $this->assert Equals( array(), $this->interactivity->state( 'myPlugin' ) );73 $this->assert Equals( array(), $this->interactivity->config( 'myPlugin' ) );72 $this->assertSame( array(), $this->interactivity->state( 'myPlugin' ) ); 73 $this->assertSame( array(), $this->interactivity->config( 'myPlugin' ) ); 74 74 } 75 75 … … 90 90 ); 91 91 $result = $this->interactivity->state( 'myPlugin', $state ); 92 $this->assert Equals( $state, $result );92 $this->assertSame( $state, $result ); 93 93 $result = $this->interactivity->config( 'myPlugin', $state ); 94 $this->assert Equals( $state, $result );94 $this->assertSame( $state, $result ); 95 95 } 96 96 … … 107 107 $this->interactivity->state( 'myPlugin', array( 'b' => 2 ) ); 108 108 $this->interactivity->state( 'otherPlugin', array( 'c' => 3 ) ); 109 $this->assert Equals(109 $this->assertSame( 110 110 array( 111 111 'a' => 1, … … 114 114 $this->interactivity->state( 'myPlugin' ) 115 115 ); 116 $this->assert Equals(116 $this->assertSame( 117 117 array( 'c' => 3 ), 118 118 $this->interactivity->state( 'otherPlugin' ) … … 122 122 $this->interactivity->config( 'myPlugin', array( 'b' => 2 ) ); 123 123 $this->interactivity->config( 'otherPlugin', array( 'c' => 3 ) ); 124 $this->assert Equals(124 $this->assertSame( 125 125 array( 126 126 'a' => 1, … … 129 129 $this->interactivity->config( 'myPlugin' ) 130 130 ); 131 $this->assert Equals(131 $this->assertSame( 132 132 array( 'c' => 3 ), 133 133 $this->interactivity->config( 'otherPlugin' ) … … 146 146 $this->interactivity->state( 'myPlugin', array( 'a' => 1 ) ); 147 147 $this->interactivity->state( 'myPlugin', array( 'a' => 2 ) ); 148 $this->assert Equals(148 $this->assertSame( 149 149 array( 'a' => 2 ), 150 150 $this->interactivity->state( 'myPlugin' ) … … 153 153 $this->interactivity->config( 'myPlugin', array( 'a' => 1 ) ); 154 154 $this->interactivity->config( 'myPlugin', array( 'a' => 2 ) ); 155 $this->assert Equals(155 $this->assertSame( 156 156 array( 'a' => 2 ), 157 157 $this->interactivity->config( 'myPlugin' ) … … 171 171 $this->interactivity->state( 'myPlugin', array( 'a' => array( 1, 2 ) ) ); 172 172 $this->interactivity->state( 'myPlugin', array( 'a' => array( 3, 4 ) ) ); 173 $this->assert Equals(173 $this->assertSame( 174 174 array( 'a' => array( 3, 4 ) ), 175 175 $this->interactivity->state( 'myPlugin' ) … … 178 178 $this->interactivity->config( 'myPlugin', array( 'a' => array( 1, 2 ) ) ); 179 179 $this->interactivity->config( 'myPlugin', array( 'a' => array( 3, 4 ) ) ); 180 $this->assert Equals(180 $this->assertSame( 181 181 array( 'a' => array( 3, 4 ) ), 182 182 $this->interactivity->config( 'myPlugin' ) … … 219 219 ); 220 220 221 $this->assertEquals( 222 array( 221 $this->assertSame( 222 array( 223 'config' => $data, 223 224 'state' => $data, 224 'config' => $data,225 225 ), 226 226 $result … … 252 252 $this->interactivity->state( 'myPlugin', array( 'a' => 1 ) ); 253 253 $result = $this->print_client_interactivity_data(); 254 $this->assert Equals( array( 'state' => array( 'myPlugin' => array( 'a' => 1 ) ) ), $result );254 $this->assertSame( array( 'state' => array( 'myPlugin' => array( 'a' => 1 ) ) ), $result ); 255 255 } 256 256 … … 266 266 $this->interactivity->config( 'myPlugin', array( 'a' => 1 ) ); 267 267 $result = $this->print_client_interactivity_data(); 268 $this->assert Equals( array( 'config' => array( 'myPlugin' => array( 'a' => 1 ) ) ), $result );268 $this->assertSame( array( 'config' => array( 'myPlugin' => array( 'a' => 1 ) ) ), $result ); 269 269 } 270 270 … … 287 287 SCRIPT_TAG; 288 288 289 $this->assertSame ( $expected, $printed_script );289 $this->assertSameIgnoreEOL( $expected, $printed_script ); 290 290 } 291 291 … … 320 320 SCRIPT_TAG; 321 321 322 $this->assertSame ( $expected, $printed_script );322 $this->assertSameIgnoreEOL( $expected, $printed_script ); 323 323 } 324 324 … … 341 341 SCRIPT_TAG; 342 342 343 $this->assertSame ( $expected, $printed_script );343 $this->assertSameIgnoreEOL( $expected, $printed_script ); 344 344 } 345 345 … … 374 374 SCRIPT_TAG; 375 375 376 $this->assertSame ( $expected, $printed_script );376 $this->assertSameIgnoreEOL( $expected, $printed_script ); 377 377 } 378 378 … … 411 411 {"config":{"myPlugin":{"chars":"&\\u003C\\u003E/"}},"state":{"myPlugin":{"ampersand":"&","less-than sign":"\\u003C","greater-than sign":"\\u003E","solidus":"/","line separator":"\u{2028}","paragraph separator":"\u{2029}","flag of england":"\u{1F3F4}\u{E0067}\u{E0062}\u{E0065}\u{E006E}\u{E0067}\u{E007F}","malicious script closer":"\\u003C/script\\u003E","entity-encoded malicious script closer":"</script>"}}} 412 412 JSON; 413 $this->assert Equals( $expected, $interactivity_data_string[1] );413 $this->assertSame( $expected, $interactivity_data_string[1] ); 414 414 } 415 415 … … 451 451 {"config":{"myPlugin":{"chars":"&\\u003C\\u003E/"}},"state":{"myPlugin":{"ampersand":"&","less-than sign":"\\u003C","greater-than sign":"\\u003E","solidus":"/","line separator":"\\u2028","paragraph separator":"\\u2029","flag of england":"\\ud83c\\udff4\\udb40\\udc67\\udb40\\udc62\\udb40\\udc65\\udb40\\udc6e\\udb40\\udc67\\udb40\\udc7f","malicious script closer":"\\u003C/script\\u003E","entity-encoded malicious script closer":"</script>"}}} 452 452 JSON; 453 $this->assert Equals( $expected, $interactivity_data_string[1] );453 $this->assertSame( $expected, $interactivity_data_string[1] ); 454 454 } 455 455 … … 468 468 $this->interactivity->state( 'otherPlugin', array( 'b' => 2 ) ); 469 469 470 $this->assert Equals(470 $this->assertSame( 471 471 array( 'a' => 1 ), 472 472 $this->interactivity->state() … … 489 489 $this->interactivity->state( 'otherPlugin', array( 'b' => 2 ) ); 490 490 491 $this->assert Equals(491 $this->assertSame( 492 492 array(), 493 493 $this->interactivity->state( null, array( 'newProp' => 'value' ) ) … … 509 509 $this->interactivity->state( 'otherPlugin', array( 'b' => 2 ) ); 510 510 511 $this->assert Equals(511 $this->assertSame( 512 512 array(), 513 513 $this->interactivity->state( '' ) … … 525 525 */ 526 526 public function test_state_without_namespace_outside_directive_processing() { 527 $this->assert Equals(527 $this->assertSame( 528 528 array(), 529 529 $this->interactivity->state() … … 551 551 ); 552 552 553 $this->assert Equals(553 $this->assertSame( 554 554 array( 'a' => 1 ), 555 555 $this->interactivity->get_context( 'myPlugin' ) 556 556 ); 557 $this->assert Equals(557 $this->assertSame( 558 558 array( 'b' => 2 ), 559 559 $this->interactivity->get_context( 'otherPlugin' ) … … 581 581 ); 582 582 583 $this->assert Equals(583 $this->assertSame( 584 584 array( 'a' => 1 ), 585 585 $this->interactivity->get_context() … … 599 599 $this->set_internal_context_stack(); 600 600 601 $this->assert Equals(601 $this->assertSame( 602 602 array(), 603 603 $this->interactivity->get_context( 'myPlugin' ) … … 624 624 ); 625 625 626 $this->assert Equals(626 $this->assertSame( 627 627 array(), 628 628 $this->interactivity->get_context( 'otherPlugin' ) … … 649 649 ); 650 650 651 $this->assert Equals(651 $this->assertSame( 652 652 array(), 653 653 $this->interactivity->get_context( '' ) … … 667 667 public function test_get_context_outside_of_directive_processing() { 668 668 $context = $this->interactivity->get_context(); 669 $this->assert Equals( array(), $context );669 $this->assertSame( array(), $context ); 670 670 } 671 671 … … 682 682 683 683 $result = $extract_directive_value->invoke( $this->interactivity, 'state.foo', 'myPlugin' ); 684 $this->assert Equals( array( 'myPlugin', 'state.foo' ), $result );684 $this->assertSame( array( 'myPlugin', 'state.foo' ), $result ); 685 685 686 686 $result = $extract_directive_value->invoke( $this->interactivity, 'otherPlugin::state.foo', 'myPlugin' ); 687 $this->assert Equals( array( 'otherPlugin', 'state.foo' ), $result );687 $this->assertSame( array( 'otherPlugin', 'state.foo' ), $result ); 688 688 689 689 $result = $extract_directive_value->invoke( $this->interactivity, '{ "isOpen": false }', 'myPlugin' ); 690 $this->assert Equals( array( 'myPlugin', array( 'isOpen' => false ) ), $result );690 $this->assertSame( array( 'myPlugin', array( 'isOpen' => false ) ), $result ); 691 691 692 692 $result = $extract_directive_value->invoke( $this->interactivity, 'otherPlugin::{ "isOpen": false }', 'myPlugin' ); 693 $this->assert Equals( array( 'otherPlugin', array( 'isOpen' => false ) ), $result );693 $this->assertSame( array( 'otherPlugin', array( 'isOpen' => false ) ), $result ); 694 694 695 695 $result = $extract_directive_value->invoke( $this->interactivity, 'true', 'myPlugin' ); 696 $this->assert Equals( array( 'myPlugin', true ), $result );696 $this->assertSame( array( 'myPlugin', true ), $result ); 697 697 698 698 $result = $extract_directive_value->invoke( $this->interactivity, 'false', 'myPlugin' ); 699 $this->assert Equals( array( 'myPlugin', false ), $result );699 $this->assertSame( array( 'myPlugin', false ), $result ); 700 700 701 701 $result = $extract_directive_value->invoke( $this->interactivity, 'null', 'myPlugin' ); 702 $this->assert Equals( array( 'myPlugin', null ), $result );702 $this->assertSame( array( 'myPlugin', null ), $result ); 703 703 704 704 $result = $extract_directive_value->invoke( $this->interactivity, '100', 'myPlugin' ); 705 $this->assert Equals( array( 'myPlugin', 100 ), $result );705 $this->assertSame( array( 'myPlugin', 100 ), $result ); 706 706 707 707 $result = $extract_directive_value->invoke( $this->interactivity, '1.2', 'myPlugin' ); 708 $this->assert Equals( array( 'myPlugin', 1.2 ), $result );708 $this->assertSame( array( 'myPlugin', 1.2 ), $result ); 709 709 710 710 $result = $extract_directive_value->invoke( $this->interactivity, '1.2.3', 'myPlugin' ); 711 $this->assert Equals( array( 'myPlugin', '1.2.3' ), $result );711 $this->assertSame( array( 'myPlugin', '1.2.3' ), $result ); 712 712 713 713 $result = $extract_directive_value->invoke( $this->interactivity, 'otherPlugin::true', 'myPlugin' ); 714 $this->assert Equals( array( 'otherPlugin', true ), $result );714 $this->assertSame( array( 'otherPlugin', true ), $result ); 715 715 716 716 $result = $extract_directive_value->invoke( $this->interactivity, 'otherPlugin::false', 'myPlugin' ); 717 $this->assert Equals( array( 'otherPlugin', false ), $result );717 $this->assertSame( array( 'otherPlugin', false ), $result ); 718 718 719 719 $result = $extract_directive_value->invoke( $this->interactivity, 'otherPlugin::null', 'myPlugin' ); 720 $this->assert Equals( array( 'otherPlugin', null ), $result );720 $this->assertSame( array( 'otherPlugin', null ), $result ); 721 721 722 722 $result = $extract_directive_value->invoke( $this->interactivity, 'otherPlugin::100', 'myPlugin' ); 723 $this->assert Equals( array( 'otherPlugin', 100 ), $result );723 $this->assertSame( array( 'otherPlugin', 100 ), $result ); 724 724 725 725 $result = $extract_directive_value->invoke( $this->interactivity, 'otherPlugin::1.2', 'myPlugin' ); 726 $this->assert Equals( array( 'otherPlugin', 1.2 ), $result );726 $this->assertSame( array( 'otherPlugin', 1.2 ), $result ); 727 727 728 728 $result = $extract_directive_value->invoke( $this->interactivity, 'otherPlugin::1.2.3', 'myPlugin' ); 729 $this->assert Equals( array( 'otherPlugin', '1.2.3' ), $result );729 $this->assertSame( array( 'otherPlugin', '1.2.3' ), $result ); 730 730 731 731 $result = $extract_directive_value->invoke( $this->interactivity, 'otherPlugin::[{"o":4}, null, 3e6]', 'myPlugin' ); 732 $this->assert Equals( array( 'otherPlugin', array( array( 'o' => 4 ), null, 3000000.0 ) ), $result );732 $this->assertSame( array( 'otherPlugin', array( array( 'o' => 4 ), null, 3000000.0 ) ), $result ); 733 733 } 734 734 … … 745 745 746 746 $result = $extract_directive_value->invoke( $this->interactivity, '', 'myPlugin' ); 747 $this->assert Equals( array( 'myPlugin', null ), $result );747 $this->assertSame( array( 'myPlugin', null ), $result ); 748 748 749 749 // This is a boolean attribute. 750 750 $result = $extract_directive_value->invoke( $this->interactivity, true, 'myPlugin' ); 751 $this->assert Equals( array( 'myPlugin', null ), $result );751 $this->assertSame( array( 'myPlugin', null ), $result ); 752 752 753 753 $result = $extract_directive_value->invoke( $this->interactivity, false, 'myPlugin' ); 754 $this->assert Equals( array( 'myPlugin', null ), $result );754 $this->assertSame( array( 'myPlugin', null ), $result ); 755 755 756 756 $result = $extract_directive_value->invoke( $this->interactivity, null, 'myPlugin' ); 757 $this->assert Equals( array( 'myPlugin', null ), $result );757 $this->assertSame( array( 'myPlugin', null ), $result ); 758 758 759 759 // A string ending in `::` without any extra characters is not considered a 760 760 // namespace. 761 761 $result = $extract_directive_value->invoke( $this->interactivity, 'myPlugin::', 'myPlugin' ); 762 $this->assert Equals( array( 'myPlugin', 'myPlugin::' ), $result );762 $this->assertSame( array( 'myPlugin', 'myPlugin::' ), $result ); 763 763 764 764 // A namespace with invalid characters is not considered a valid namespace. 765 765 $result = $extract_directive_value->invoke( $this->interactivity, '$myPlugin::state.foo', 'myPlugin' ); 766 $this->assert Equals( array( 'myPlugin', '$myPlugin::state.foo' ), $result );766 $this->assertSame( array( 'myPlugin', '$myPlugin::state.foo' ), $result ); 767 767 } 768 768 … … 780 780 // Invalid JSON due to missing quotes. Returns the original value. 781 781 $result = $extract_directive_value->invoke( $this->interactivity, '{ isOpen: false }', 'myPlugin' ); 782 $this->assert Equals( array( 'myPlugin', '{ isOpen: false }' ), $result );782 $this->assertSame( array( 'myPlugin', '{ isOpen: false }' ), $result ); 783 783 784 784 // Null string. Returns null. 785 785 $result = $extract_directive_value->invoke( $this->interactivity, 'null', 'myPlugin' ); 786 $this->assert Equals( array( 'myPlugin', null ), $result );786 $this->assertSame( array( 'myPlugin', null ), $result ); 787 787 } 788 788 … … 800 800 801 801 $result = $extract_prefix_and_suffix->invoke( $this->interactivity, 'data-wp-interactive' ); 802 $this->assert Equals( array( 'data-wp-interactive' ), $result );802 $this->assertSame( array( 'data-wp-interactive' ), $result ); 803 803 804 804 $result = $extract_prefix_and_suffix->invoke( $this->interactivity, 'data-wp-bind--src' ); 805 $this->assert Equals( array( 'data-wp-bind', 'src' ), $result );805 $this->assertSame( array( 'data-wp-bind', 'src' ), $result ); 806 806 807 807 $result = $extract_prefix_and_suffix->invoke( $this->interactivity, 'data-wp-foo--and--bar' ); 808 $this->assert Equals( array( 'data-wp-foo', 'and--bar' ), $result );808 $this->assertSame( array( 'data-wp-foo', 'and--bar' ), $result ); 809 809 } 810 810 … … 820 820 $html = '<div>Inner content here</div>'; 821 821 $processed_html = $this->interactivity->process_directives( $html ); 822 $this->assert Equals( $html, $processed_html );822 $this->assertSame( $html, $processed_html ); 823 823 824 824 $html = '<div><span>Content</span><strong>More Content</strong></div>'; 825 825 $processed_html = $this->interactivity->process_directives( $html ); 826 $this->assert Equals( $html, $processed_html );826 $this->assertSame( $html, $processed_html ); 827 827 } 828 828 … … 841 841 $p = new WP_HTML_Tag_Processor( $processed_html ); 842 842 $p->next_tag(); 843 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );843 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 844 844 } 845 845 … … 854 854 $html = '<div data-wp-unknown="">Text</div>'; 855 855 $processed_html = $this->interactivity->process_directives( $html ); 856 $this->assert Equals( $html, $processed_html );856 $this->assertSame( $html, $processed_html ); 857 857 } 858 858 … … 877 877 $p = new WP_HTML_Tag_Processor( $processed_html ); 878 878 $p->next_tag(); 879 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );880 $this->assert Equals( 'some-class', $p->get_attribute( 'class' ) );881 $this->assert Equals( 'display:none;', $p->get_attribute( 'style' ) );879 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 880 $this->assertSame( 'some-class', $p->get_attribute( 'class' ) ); 881 $this->assertSame( 'display:none;', $p->get_attribute( 'style' ) ); 882 882 $this->assertStringContainsString( 'Updated', $p->get_updated_html() ); 883 883 $this->assertStringNotContainsString( 'Text', $p->get_updated_html() ); … … 953 953 $p = new WP_HTML_Tag_Processor( $processed_html ); 954 954 $p->next_tag( 'div' ); 955 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );955 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 956 956 } 957 957 … … 1018 1018 $this->assertNull( $p->get_attribute( 'id' ) ); 1019 1019 $p->next_tag( 'div' ); 1020 $this->assert Equals( 'some-id', $p->get_attribute( 'id' ) );1020 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 1021 1021 } 1022 1022 … … 1122 1122 1123 1123 $result = $this->evaluate( 'state.key' ); 1124 $this->assert Equals( 'myPlugin-state', $result );1124 $this->assertSame( 'myPlugin-state', $result ); 1125 1125 1126 1126 $result = $this->evaluate( 'context.key' ); 1127 $this->assert Equals( 'myPlugin-context', $result );1127 $this->assertSame( 'myPlugin-context', $result ); 1128 1128 1129 1129 $result = $this->evaluate( 'otherPlugin::state.key' ); 1130 $this->assert Equals( 'otherPlugin-state', $result );1130 $this->assertSame( 'otherPlugin-state', $result ); 1131 1131 1132 1132 $result = $this->evaluate( 'otherPlugin::context.key' ); 1133 $this->assert Equals( 'otherPlugin-context', $result );1133 $this->assertSame( 'otherPlugin-context', $result ); 1134 1134 1135 1135 $result = $this->evaluate( 'state.obj.prop' ); … … 1242 1242 1243 1243 $result = $this->evaluate( 'state.nested.key' ); 1244 $this->assert Equals( 'myPlugin-state-nested', $result );1244 $this->assertSame( 'myPlugin-state-nested', $result ); 1245 1245 1246 1246 $result = $this->evaluate( 'context.nested.key' ); 1247 $this->assert Equals( 'myPlugin-context-nested', $result );1247 $this->assertSame( 'myPlugin-context-nested', $result ); 1248 1248 1249 1249 $result = $this->evaluate( 'otherPlugin::state.nested.key' ); 1250 $this->assert Equals( 'otherPlugin-state-nested', $result );1250 $this->assertSame( 'otherPlugin-state-nested', $result ); 1251 1251 1252 1252 $result = $this->evaluate( 'otherPlugin::context.nested.key' ); 1253 $this->assert Equals( 'otherPlugin-context-nested', $result );1253 $this->assertSame( 'otherPlugin-context-nested', $result ); 1254 1254 } 1255 1255 -
trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPIDirectivesProcessor.php
r57987 r58594 25 25 $p = new WP_Interactivity_API_Directives_Processor( $content ); 26 26 $p->next_tag(); 27 $this->assert Equals( 'Text', $p->get_content_between_balanced_template_tags() );27 $this->assertSame( 'Text', $p->get_content_between_balanced_template_tags() ); 28 28 29 29 $content = '<template>Text</template><template>More text</template>'; 30 30 $p = new WP_Interactivity_API_Directives_Processor( $content ); 31 31 $p->next_tag(); 32 $this->assert Equals( 'Text', $p->get_content_between_balanced_template_tags() );33 $p->next_tag(); 34 $this->assert Equals( 'More text', $p->get_content_between_balanced_template_tags() );32 $this->assertSame( 'Text', $p->get_content_between_balanced_template_tags() ); 33 $p->next_tag(); 34 $this->assertSame( 'More text', $p->get_content_between_balanced_template_tags() ); 35 35 } 36 36 … … 47 47 $p = new WP_Interactivity_API_Directives_Processor( $content ); 48 48 $p->next_tag(); 49 $this->assert Equals( '', $p->get_content_between_balanced_template_tags() );49 $this->assertSame( '', $p->get_content_between_balanced_template_tags() ); 50 50 } 51 51 … … 82 82 $p = new WP_Interactivity_API_Directives_Processor( $content ); 83 83 $p->next_tag(); 84 $this->assert Equals( '<span>Content</span><strong>More Content</strong>', $p->get_content_between_balanced_template_tags() );84 $this->assertSame( '<span>Content</span><strong>More Content</strong>', $p->get_content_between_balanced_template_tags() ); 85 85 86 86 $content = '<template><template>Content</template><img src="example.jpg"></template>'; 87 87 $p = new WP_Interactivity_API_Directives_Processor( $content ); 88 88 $p->next_tag(); 89 $this->assert Equals( '<template>Content</template><img src="example.jpg">', $p->get_content_between_balanced_template_tags() );89 $this->assertSame( '<template>Content</template><img src="example.jpg">', $p->get_content_between_balanced_template_tags() ); 90 90 } 91 91 … … 132 132 $p = new WP_Interactivity_API_Directives_Processor( $content ); 133 133 $p->next_tag(); 134 $this->assert Equals( 'Missing opening span</span>', $p->get_content_between_balanced_template_tags() );134 $this->assertSame( 'Missing opening span</span>', $p->get_content_between_balanced_template_tags() ); 135 135 } 136 136 … … 164 164 $p->next_tag(); 165 165 $p->get_content_between_balanced_template_tags(); 166 $this->assert Equals( 'TEMPLATE', $p->get_tag() );166 $this->assertSame( 'TEMPLATE', $p->get_tag() ); 167 167 $this->assertTrue( $p->is_tag_closer() ); 168 168 $p->next_tag(); 169 $this->assert Equals( 'DIV', $p->get_tag() );169 $this->assertSame( 'DIV', $p->get_tag() ); 170 170 } 171 171 … … 480 480 $this->assertEquals( $content_1 . $content_2, $p ); 481 481 $p->next_tag( array( 'tag_closers' => 'visit' ) ); 482 $this->assert Equals( 'content-2', $p->get_attribute( 'class' ) );482 $this->assertSame( 'content-2', $p->get_attribute( 'class' ) ); 483 483 $p->next_tag( array( 'tag_closers' => 'visit' ) ); 484 484 $result = $p->append_content_after_template_tag_closer( $content_3 ); … … 486 486 $p->next_tag( array( 'tag_closers' => 'visit' ) ); 487 487 $this->assertEquals( $content_1 . $content_2 . $content_3, $p ); 488 $this->assert Equals( 'content-3', $p->get_attribute( 'class' ) );488 $this->assertSame( 'content-3', $p->get_attribute( 'class' ) ); 489 489 } 490 490 … … 510 510 $this->assertEquals( $content_1 . $content_2 . $content_3, $p ); 511 511 $p->next_tag( array( 'tag_closers' => 'visit' ) ); 512 $this->assert Equals( 'content-3', $p->get_attribute( 'class' ) );512 $this->assertSame( 'content-3', $p->get_attribute( 'class' ) ); 513 513 514 514 $p = new WP_Interactivity_API_Directives_Processor( $content_1 . $content_3 ); … … 519 519 $this->assertEquals( $content_1 . $content_4 . $content_3, $p ); 520 520 $p->next_tag( array( 'tag_closers' => 'visit' ) ); 521 $this->assert Equals( 'content-4', $p->get_attribute( 'class' ) );521 $this->assertSame( 'content-4', $p->get_attribute( 'class' ) ); 522 522 } 523 523 … … 559 559 $this->assertEquals( $content_1 . $content_2, $p ); 560 560 $p->next_tag( array( 'tag_closers' => 'visit' ) ); 561 $this->assert Equals( 'content-2', $p->get_attribute( 'class' ) );561 $this->assertSame( 'content-2', $p->get_attribute( 'class' ) ); 562 562 // Rewinds to the first template. 563 563 $p->seek( 'first template' ); 564 564 $p->release_bookmark( 'first template' ); 565 $this->assert Equals( 'content-1', $p->get_attribute( 'class' ) );565 $this->assertSame( 'content-1', $p->get_attribute( 'class' ) ); 566 566 $p->next_tag( array( 'tag_closers' => 'visit' ) ); 567 567 $result = $p->append_content_after_template_tag_closer( $content_3 ); 568 568 $this->assertEquals( $content_1 . $content_3 . $content_2, $p ); 569 569 $p->next_tag( array( 'tag_closers' => 'visit' ) ); 570 $this->assert Equals( 'content-3', $p->get_attribute( 'class' ) );570 $this->assertSame( 'content-3', $p->get_attribute( 'class' ) ); 571 571 } 572 572 … … 616 616 $this->assertEquals( $content_1 . $content_2, $p ); 617 617 $p->next_tag(); 618 $this->assert Equals( 'content-2-template-1', $p->get_attribute( 'class' ) );619 $p->next_tag(); 620 $this->assert Equals( 'content-2-template-2', $p->get_attribute( 'class' ) );618 $this->assertSame( 'content-2-template-1', $p->get_attribute( 'class' ) ); 619 $p->next_tag(); 620 $this->assertSame( 'content-2-template-2', $p->get_attribute( 'class' ) ); 621 621 $p->next_tag( array( 'tag_closers' => 'visit' ) ); 622 622 $result = $p->append_content_after_template_tag_closer( $content_3 ); … … 641 641 $this->assertFalse( $result ); 642 642 $this->assertEquals( $content, $p ); 643 $this->assert Equals( 'TEMPLATE', $p->get_tag() ); // It didn't move.643 $this->assertSame( 'TEMPLATE', $p->get_tag() ); // It didn't move. 644 644 $this->assertTrue( $p->is_tag_closer() ); // It didn't move. 645 645 } … … 695 695 $p->next_tag(); 696 696 $this->assertTrue( $p->next_balanced_tag_closer_tag() ); 697 $this->assert Equals( 'DIV', $p->get_tag() );697 $this->assertSame( 'DIV', $p->get_tag() ); 698 698 $this->assertTrue( $p->is_tag_closer() ); 699 699 } … … 732 732 $p->next_tag(); 733 733 $this->assertTrue( $p->next_balanced_tag_closer_tag() ); 734 $this->assert Equals( 'DIV', $p->get_tag() );734 $this->assertSame( 'DIV', $p->get_tag() ); 735 735 $this->assertTrue( $p->is_tag_closer() ); 736 736 … … 739 739 $p->next_tag(); 740 740 $this->assertTrue( $p->next_balanced_tag_closer_tag() ); 741 $this->assert Equals( 'DIV', $p->get_tag() );741 $this->assertSame( 'DIV', $p->get_tag() ); 742 742 $this->assertTrue( $p->is_tag_closer() ); 743 743 $this->assertFalse( $p->next_tag() ); // No more content. … … 794 794 $this->assertTrue( $p->skip_to_tag_closer() ); 795 795 $this->assertTrue( $p->is_tag_closer() ); 796 $this->assert Equals( 'DIV', $p->get_tag() );796 $this->assertSame( 'DIV', $p->get_tag() ); 797 797 } 798 798 -
trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPIFunctions.php
r58234 r58594 77 77 $p = new WP_HTML_Tag_Processor( $rendered_blocks ); 78 78 $p->next_tag( array( 'class_name' => 'interactive/block-1' ) ); 79 $this->assert Equals( '1', $p->get_attribute( 'value' ) );79 $this->assertSame( '1', $p->get_attribute( 'value' ) ); 80 80 } 81 81 … … 98 98 $p = new WP_HTML_Tag_Processor( $rendered_blocks ); 99 99 $p->next_tag( array( 'class_name' => 'interactive/block-1' ) ); 100 $this->assert Equals( '1', $p->get_attribute( 'value' ) );100 $this->assertSame( '1', $p->get_attribute( 'value' ) ); 101 101 $p->next_tag( array( 'class_name' => 'interactive/block-2' ) ); 102 $this->assert Equals( '2', $p->get_attribute( 'value' ) );102 $this->assertSame( '2', $p->get_attribute( 'value' ) ); 103 103 $p->next_tag( array( 'class_name' => 'non-interactive/block-3' ) ); 104 104 $this->assertNull( $p->get_attribute( 'value' ) ); 105 105 $p->next_tag( array( 'class_name' => 'interactive/block-4' ) ); 106 $this->assert Equals( '4', $p->get_attribute( 'value' ) );106 $this->assertSame( '4', $p->get_attribute( 'value' ) ); 107 107 } 108 108 … … 123 123 $p = new WP_HTML_Tag_Processor( $rendered_blocks ); 124 124 $p->next_tag( array( 'class_name' => 'interactive/block-2' ) ); 125 $this->assert Equals( '2', $p->get_attribute( 'value' ) );125 $this->assertSame( '2', $p->get_attribute( 'value' ) ); 126 126 } 127 127 … … 144 144 $p = new WP_HTML_Tag_Processor( $rendered_blocks ); 145 145 $p->next_tag( array( 'class_name' => 'interactive/block-2' ) ); 146 $this->assert Equals( '2', $p->get_attribute( 'value' ) );146 $this->assertSame( '2', $p->get_attribute( 'value' ) ); 147 147 $p->next_tag( array( 'class_name' => 'interactive/block-3' ) ); 148 $this->assert Equals( '3', $p->get_attribute( 'value' ) );148 $this->assertSame( '3', $p->get_attribute( 'value' ) ); 149 149 } 150 150 … … 169 169 $p = new WP_HTML_Tag_Processor( $rendered_blocks ); 170 170 $p->next_tag( array( 'class_name' => 'interactive/block-2' ) ); 171 $this->assert Equals( '2', $p->get_attribute( 'value' ) );171 $this->assertSame( '2', $p->get_attribute( 'value' ) ); 172 172 $p->next_tag( array( 'class_name' => 'interactive/block-4' ) ); 173 $this->assert Equals( '4', $p->get_attribute( 'value' ) );173 $this->assertSame( '4', $p->get_attribute( 'value' ) ); 174 174 } 175 175 … … 191 191 $p = new WP_HTML_Tag_Processor( $rendered_blocks ); 192 192 $p->next_tag( array( 'class_name' => 'interactive/block-1' ) ); 193 $this->assert Equals( '1', $p->get_attribute( 'value' ) );193 $this->assertSame( '1', $p->get_attribute( 'value' ) ); 194 194 $p->next_tag( array( 'class_name' => 'non-interactive/block-2' ) ); 195 195 $this->assertNull( $p->get_attribute( 'value' ) ); … … 213 213 $p = new WP_HTML_Tag_Processor( $rendered_blocks ); 214 214 $p->next_tag( array( 'class_name' => 'interactive/block-1' ) ); 215 $this->assert Equals( '1', $p->get_attribute( 'value' ) );215 $this->assertSame( '1', $p->get_attribute( 'value' ) ); 216 216 $p->next_tag( array( 'class_name' => 'non-interactive/block-2' ) ); 217 $this->assert Equals( '1', $p->get_attribute( 'value' ) );217 $this->assertSame( '1', $p->get_attribute( 'value' ) ); 218 218 } 219 219 … … 239 239 $p = new WP_HTML_Tag_Processor( $rendered_blocks ); 240 240 $p->next_tag( array( 'class_name' => 'interactive/block-1' ) ); 241 $this->assert Equals( '1', $p->get_attribute( 'value' ) );241 $this->assertSame( '1', $p->get_attribute( 'value' ) ); 242 242 $p->next_tag( array( 'class_name' => 'interactive/block-2' ) ); 243 $this->assert Equals( '2', $p->get_attribute( 'value' ) );243 $this->assertSame( '2', $p->get_attribute( 'value' ) ); 244 244 $p->next_tag( array( 'class_name' => 'non-interactive/block-3' ) ); 245 $this->assert Equals( '2', $p->get_attribute( 'value' ) );245 $this->assertSame( '2', $p->get_attribute( 'value' ) ); 246 246 $p->next_tag( array( 'class_name' => 'non-interactive/block-4' ) ); 247 $this->assert Equals( '1', $p->get_attribute( 'value' ) );247 $this->assertSame( '1', $p->get_attribute( 'value' ) ); 248 248 } 249 249 … … 289 289 $this->data_wp_test_processor_count = 0; 290 290 wp_interactivity_process_directives( $html ); 291 $this->assert Equals( 1, $this->data_wp_test_processor_count );291 $this->assertSame( 1, $this->data_wp_test_processor_count ); 292 292 293 293 register_block_type( … … 310 310 do_blocks( $post_content ); 311 311 unregister_block_type( 'test/custom-directive-block' ); 312 $this->assert Equals( 2, $this->data_wp_test_processor_count );312 $this->assertSame( 2, $this->data_wp_test_processor_count ); 313 313 $directive_processors->setValue( null, $old_directive_processors ); 314 314 } … … 344 344 remove_filter( 'render_block_data', 'test_render_block_data' ); 345 345 unregister_block_type( 'test/custom-directive-block' ); 346 $this->assert Equals( 'test', $processor->get_attribute( 'value' ) );346 $this->assertSame( 'test', $processor->get_attribute( 'value' ) ); 347 347 } 348 348 … … 356 356 */ 357 357 public function test_wp_interactivity_data_wp_context_with_different_arrays() { 358 $this->assert Equals( 'data-wp-context=\'{}\'', wp_interactivity_data_wp_context( array() ) );359 $this->assert Equals(358 $this->assertSame( 'data-wp-context=\'{}\'', wp_interactivity_data_wp_context( array() ) ); 359 $this->assertSame( 360 360 'data-wp-context=\'{"a":1,"b":"2","c":true}\'', 361 361 wp_interactivity_data_wp_context( … … 367 367 ) 368 368 ); 369 $this->assert Equals(369 $this->assertSame( 370 370 'data-wp-context=\'{"a":[1,2]}\'', 371 371 wp_interactivity_data_wp_context( array( 'a' => array( 1, 2 ) ) ) 372 372 ); 373 $this->assert Equals(373 $this->assertSame( 374 374 'data-wp-context=\'[1,2]\'', 375 375 wp_interactivity_data_wp_context( array( 1, 2 ) ) … … 386 386 */ 387 387 public function test_wp_interactivity_data_wp_context_with_different_arrays_and_a_namespace() { 388 $this->assert Equals( 'data-wp-context=\'myPlugin::{}\'', wp_interactivity_data_wp_context( array(), 'myPlugin' ) );389 $this->assert Equals(388 $this->assertSame( 'data-wp-context=\'myPlugin::{}\'', wp_interactivity_data_wp_context( array(), 'myPlugin' ) ); 389 $this->assertSame( 390 390 'data-wp-context=\'myPlugin::{"a":1,"b":"2","c":true}\'', 391 391 wp_interactivity_data_wp_context( … … 398 398 ) 399 399 ); 400 $this->assert Equals(400 $this->assertSame( 401 401 'data-wp-context=\'myPlugin::{"a":[1,2]}\'', 402 402 wp_interactivity_data_wp_context( array( 'a' => array( 1, 2 ) ), 'myPlugin' ) 403 403 ); 404 $this->assert Equals(404 $this->assertSame( 405 405 'data-wp-context=\'myPlugin::[1,2]\'', 406 406 wp_interactivity_data_wp_context( array( 1, 2 ), 'myPlugin' ) … … 419 419 */ 420 420 public function test_wp_interactivity_data_wp_context_with_json_flags() { 421 $this->assert Equals( 'data-wp-context=\'{"tag":"\u003Cfoo\u003E"}\'', wp_interactivity_data_wp_context( array( 'tag' => '<foo>' ) ) );422 $this->assert Equals( 'data-wp-context=\'{"apos":"\u0027bar\u0027"}\'', wp_interactivity_data_wp_context( array( 'apos' => "'bar'" ) ) );423 $this->assert Equals( 'data-wp-context=\'{"quot":"\u0022baz\u0022"}\'', wp_interactivity_data_wp_context( array( 'quot' => '"baz"' ) ) );424 $this->assert Equals( 'data-wp-context=\'{"amp":"T\u0026T"}\'', wp_interactivity_data_wp_context( array( 'amp' => 'T&T' ) ) );421 $this->assertSame( 'data-wp-context=\'{"tag":"\u003Cfoo\u003E"}\'', wp_interactivity_data_wp_context( array( 'tag' => '<foo>' ) ) ); 422 $this->assertSame( 'data-wp-context=\'{"apos":"\u0027bar\u0027"}\'', wp_interactivity_data_wp_context( array( 'apos' => "'bar'" ) ) ); 423 $this->assertSame( 'data-wp-context=\'{"quot":"\u0022baz\u0022"}\'', wp_interactivity_data_wp_context( array( 'quot' => '"baz"' ) ) ); 424 $this->assertSame( 'data-wp-context=\'{"amp":"T\u0026T"}\'', wp_interactivity_data_wp_context( array( 'amp' => 'T&T' ) ) ); 425 425 } 426 426 … … 449 449 $processor->next_tag( array( 'class_name' => 'test' ) ); 450 450 unregister_block_type( 'test/custom-directive-block' ); 451 $this->assert Equals( '1', $processor->get_attribute( 'src' ) );451 $this->assertSame( '1', $processor->get_attribute( 'src' ) ); 452 452 } 453 453 … … 489 489 $second_input_value = $processor->get_attribute( 'value' ); 490 490 unregister_block_type( 'test/custom-directive-block' ); 491 $this->assert Equals( 'inner', $first_input_value );492 $this->assert Equals( 'outer', $second_input_value );491 $this->assertSame( 'inner', $first_input_value ); 492 $this->assertSame( 'outer', $second_input_value ); 493 493 } 494 494
Note: See TracChangeset
for help on using the changeset viewer.