Changeset 58594 for trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPIDirectivesProcessor.php
- Timestamp:
- 06/28/2024 03:45:08 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.