Changeset 63622
- Timestamp:
- 09/15/2026 03:40:28 PM (8 weeks ago)
- Location:
- trunk/tests/phpunit/tests/interactivity-api
- Files:
-
- 2 edited
-
wpInteractivityAPI.php (modified) (1 diff)
-
wpInteractivityAPIDirectivesProcessor.php (modified) (30 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPI.php
r62944 r63622 1210 1210 $results = $get_directive_entries->invoke( $this->interactivity, $p, 'test' ); 1211 1211 $this->assertCount( 6, $results ); 1212 $this->assert Equals(1212 $this->assertSame( 1213 1213 array( 1214 1214 array( null, null ), -
trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPIDirectivesProcessor.php
r58594 r63622 183 183 $result = $p->set_content_between_balanced_tags( 'New text' ); 184 184 $this->assertTrue( $result ); 185 $this->assert Equals( '<div>New text</div>', $p);185 $this->assertSame( '<div>New text</div>', $p->get_updated_html() ); 186 186 187 187 $content = '<div>Text</div><div>More text</div>'; … … 190 190 $result = $p->set_content_between_balanced_tags( 'New text' ); 191 191 $this->assertTrue( $result ); 192 $this->assert Equals( '<div>New text</div><div>More text</div>', $p);192 $this->assertSame( '<div>New text</div><div>More text</div>', $p->get_updated_html() ); 193 193 $p->next_tag(); 194 194 $result = $p->set_content_between_balanced_tags( 'More new text' ); 195 195 $this->assertTrue( $result ); 196 $this->assert Equals( '<div>New text</div><div>More new text</div>', $p);196 $this->assertSame( '<div>New text</div><div>More new text</div>', $p->get_updated_html() ); 197 197 } 198 198 … … 212 212 $result = $p->set_content_between_balanced_tags( 'New text' ); 213 213 $this->assertFalse( $result ); 214 $this->assert Equals( '<div>Text</div>', $p);214 $this->assertSame( '<div>Text</div>', $p->get_updated_html() ); 215 215 } 216 216 … … 229 229 $result = $p->set_content_between_balanced_tags( 'New text' ); 230 230 $this->assertTrue( $result ); 231 $this->assert Equals( '<div>New text</div>', $p);231 $this->assertSame( '<div>New text</div>', $p->get_updated_html() ); 232 232 $result = $p->set_content_between_balanced_tags( 'More text' ); 233 233 $this->assertTrue( $result ); 234 $this->assert Equals( '<div>More text</div>', $p);234 $this->assertSame( '<div>More text</div>', $p->get_updated_html() ); 235 235 } 236 236 … … 250 250 $result = $p->set_content_between_balanced_tags( 'New text' ); 251 251 $this->assertTrue( $result ); 252 $this->assert Equals( '<div class="test">New text</div>', $p);252 $this->assertSame( '<div class="test">New text</div>', $p->get_updated_html() ); 253 253 254 254 $content = '<div>Text</div>'; … … 258 258 $this->assertTrue( $result ); 259 259 $p->set_attribute( 'class', 'test' ); 260 $this->assert Equals( '<div class="test">New text</div>', $p);260 $this->assertSame( '<div class="test">New text</div>', $p->get_updated_html() ); 261 261 } 262 262 … … 275 275 $result = $p->set_content_between_balanced_tags( 'New text' ); 276 276 $this->assertTrue( $result ); 277 $this->assert Equals( '<div>New text</div>', $p);277 $this->assertSame( '<div>New text</div>', $p->get_updated_html() ); 278 278 } 279 279 … … 292 292 $p->next_tag(); 293 293 $p->set_content_between_balanced_tags( $new_content ); 294 $this->assert Equals( '<div><span>New text</span><a href="#">Link</a></div>', $p);294 $this->assertSame( '<div><span>New text</span><a href="#">Link</a></div>', $p->get_updated_html() ); 295 295 } 296 296 … … 308 308 $result = $p->set_content_between_balanced_tags( '' ); 309 309 $this->assertTrue( $result ); 310 $this->assert Equals( '<div></div>', $p);310 $this->assertSame( '<div></div>', $p->get_updated_html() ); 311 311 312 312 $content = '<div><div>Text</div></div>'; … … 315 315 $result = $p->set_content_between_balanced_tags( '' ); 316 316 $this->assertTrue( $result ); 317 $this->assert Equals( '<div></div>', $p);317 $this->assertSame( '<div></div>', $p->get_updated_html() ); 318 318 } 319 319 … … 331 331 $result = $p->set_content_between_balanced_tags( 'New text' ); 332 332 $this->assertFalse( $result ); 333 $this->assert Equals( $content, $p);333 $this->assertSame( $content, $p->get_updated_html() ); 334 334 } 335 335 … … 347 347 $result = $p->set_content_between_balanced_tags( 'New text' ); 348 348 $this->assertFalse( $result ); 349 $this->assert Equals( $content, $p);349 $this->assertSame( $content, $p->get_updated_html() ); 350 350 } 351 351 … … 365 365 $result = $p->set_content_between_balanced_tags( $new_content ); 366 366 $this->assertFalse( $result ); 367 $this->assert Equals( $content, $p);367 $this->assertSame( $content, $p->get_updated_html() ); 368 368 369 369 $content = '<div><div>Missing closing div</div>'; … … 372 372 $result = $p->set_content_between_balanced_tags( $new_content ); 373 373 $this->assertFalse( $result ); 374 $this->assert Equals( $content, $p);374 $this->assertSame( $content, $p->get_updated_html() ); 375 375 376 376 $content = '<div>Missing closing div</span>'; … … 379 379 $result = $p->set_content_between_balanced_tags( $new_content ); 380 380 $this->assertFalse( $result ); 381 $this->assert Equals( $content, $p);381 $this->assertSame( $content, $p->get_updated_html() ); 382 382 383 383 // It supports unbalanced tags inside the content. … … 387 387 $result = $p->set_content_between_balanced_tags( $new_content ); 388 388 $this->assertTrue( $result ); 389 $this->assert Equals( '<div>New text</div>', $p);389 $this->assertSame( '<div>New text</div>', $p->get_updated_html() ); 390 390 } 391 391 … … 457 457 $result = $p->append_content_after_template_tag_closer( $content_2 ); 458 458 $this->assertTrue( $result ); 459 $this->assert Equals( $content_1 . $content_2, $p);459 $this->assertSame( $content_1 . $content_2, $p->get_updated_html() ); 460 460 $this->assertFalse( $p->next_tag() ); // There are no more tags. 461 461 } … … 478 478 $result = $p->append_content_after_template_tag_closer( $content_2 ); 479 479 $this->assertTrue( $result ); 480 $this->assert Equals( $content_1 . $content_2, $p);480 $this->assertSame( $content_1 . $content_2, $p->get_updated_html() ); 481 481 $p->next_tag( array( 'tag_closers' => 'visit' ) ); 482 482 $this->assertSame( 'content-2', $p->get_attribute( 'class' ) ); … … 485 485 $this->assertTrue( $result ); 486 486 $p->next_tag( array( 'tag_closers' => 'visit' ) ); 487 $this->assert Equals( $content_1 . $content_2 . $content_3, $p);487 $this->assertSame( $content_1 . $content_2 . $content_3, $p->get_updated_html() ); 488 488 $this->assertSame( 'content-3', $p->get_attribute( 'class' ) ); 489 489 } … … 508 508 $result = $p->append_content_after_template_tag_closer( $content_2 ); 509 509 $this->assertTrue( $result ); 510 $this->assert Equals( $content_1 . $content_2 . $content_3, $p);510 $this->assertSame( $content_1 . $content_2 . $content_3, $p->get_updated_html() ); 511 511 $p->next_tag( array( 'tag_closers' => 'visit' ) ); 512 512 $this->assertSame( 'content-3', $p->get_attribute( 'class' ) ); … … 517 517 $result = $p->append_content_after_template_tag_closer( $content_4 ); 518 518 $this->assertTrue( $result ); 519 $this->assert Equals( $content_1 . $content_4 . $content_3, $p);519 $this->assertSame( $content_1 . $content_4 . $content_3, $p->get_updated_html() ); 520 520 $p->next_tag( array( 'tag_closers' => 'visit' ) ); 521 521 $this->assertSame( 'content-4', $p->get_attribute( 'class' ) ); … … 536 536 $result = $p->append_content_after_template_tag_closer( 'New text' ); 537 537 $this->assertFalse( $result ); 538 $this->assert Equals( $content, $p);538 $this->assertSame( $content, $p->get_updated_html() ); 539 539 } 540 540 … … 557 557 $result = $p->append_content_after_template_tag_closer( $content_2 ); 558 558 $this->assertTrue( $result ); 559 $this->assert Equals( $content_1 . $content_2, $p);559 $this->assertSame( $content_1 . $content_2, $p->get_updated_html() ); 560 560 $p->next_tag( array( 'tag_closers' => 'visit' ) ); 561 561 $this->assertSame( 'content-2', $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 $this->assert Equals( $content_1 . $content_3 . $content_2, $p);568 $this->assertSame( $content_1 . $content_3 . $content_2, $p->get_updated_html() ); 569 569 $p->next_tag( array( 'tag_closers' => 'visit' ) ); 570 570 $this->assertSame( 'content-3', $p->get_attribute( 'class' ) ); … … 589 589 $result = $p->append_content_after_template_tag_closer( $content_2 ); 590 590 $this->assertTrue( $result ); 591 $this->assert Equals( '<template class="test">Text</template>' . $content_2, $p);591 $this->assertSame( '<template class="test">Text</template>' . $content_2, $p->get_updated_html() ); 592 592 } 593 593 … … 614 614 $result = $p->append_content_after_template_tag_closer( $content_2 ); 615 615 $this->assertTrue( $result ); 616 $this->assert Equals( $content_1 . $content_2, $p);616 $this->assertSame( $content_1 . $content_2, $p->get_updated_html() ); 617 617 $p->next_tag(); 618 618 $this->assertSame( 'content-2-template-1', $p->get_attribute( 'class' ) ); … … 622 622 $result = $p->append_content_after_template_tag_closer( $content_3 ); 623 623 $this->assertTrue( $result ); 624 $this->assert Equals( $content_1 . '<template class="content-2-template-1"><template class="content-2-template-2">New text</template>' . $content_3 . '</template>', $p);624 $this->assertSame( $content_1 . '<template class="content-2-template-1"><template class="content-2-template-2">New text</template>' . $content_3 . '</template>', $p->get_updated_html() ); 625 625 } 626 626 … … 640 640 $result = $p->append_content_after_template_tag_closer( '' ); 641 641 $this->assertFalse( $result ); 642 $this->assert Equals( $content, $p);642 $this->assertSame( $content, $p->get_updated_html() ); 643 643 $this->assertSame( 'TEMPLATE', $p->get_tag() ); // It didn't move. 644 644 $this->assertTrue( $p->is_tag_closer() ); // It didn't move. … … 660 660 $result = $p->append_content_after_template_tag_closer( $content_2 ); 661 661 $this->assertFalse( $result ); 662 $this->assert Equals( $content_1, $p);662 $this->assertSame( $content_1, $p->get_updated_html() ); 663 663 } 664 664 … … 679 679 $result = $p->append_content_after_template_tag_closer( $content_2 ); 680 680 $this->assertFalse( $result ); 681 $this->assert Equals( $content_1, $p);681 $this->assertSame( $content_1, $p->get_updated_html() ); 682 682 } 683 683
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)