';
$p = new WP_Interactivity_API_Directives_Processor( $content );
$p->next_tag();
$result = $p->set_content_between_balanced_tags( $new_content );
$this->assertFalse( $result );
- $this->assertEquals( $content, $p );
+ $this->assertSame( $content, $p->get_updated_html() );
$content = '
Missing closing div';
$p = new WP_Interactivity_API_Directives_Processor( $content );
$p->next_tag();
$result = $p->set_content_between_balanced_tags( $new_content );
$this->assertFalse( $result );
- $this->assertEquals( $content, $p );
+ $this->assertSame( $content, $p->get_updated_html() );
// It supports unbalanced tags inside the content.
$content = '
Missing opening span
';
@@ -386,7 +386,7 @@ public function test_set_content_between_balanced_tags_with_unbalanced_tags() {
$p->next_tag();
$result = $p->set_content_between_balanced_tags( $new_content );
$this->assertTrue( $result );
- $this->assertEquals( '
New text
', $p );
+ $this->assertSame( '
New text
', $p->get_updated_html() );
}
/**
@@ -456,7 +456,7 @@ public function test_append_content_after_template_tag_closer_simple_text() {
$p->next_tag( array( 'tag_closers' => 'visit' ) );
$result = $p->append_content_after_template_tag_closer( $content_2 );
$this->assertTrue( $result );
- $this->assertEquals( $content_1 . $content_2, $p );
+ $this->assertSame( $content_1 . $content_2, $p->get_updated_html() );
$this->assertFalse( $p->next_tag() ); // There are no more tags.
}
@@ -477,14 +477,14 @@ public function test_append_content_after_template_tag_closer_simple_tags() {
$p->next_tag( array( 'tag_closers' => 'visit' ) );
$result = $p->append_content_after_template_tag_closer( $content_2 );
$this->assertTrue( $result );
- $this->assertEquals( $content_1 . $content_2, $p );
+ $this->assertSame( $content_1 . $content_2, $p->get_updated_html() );
$p->next_tag( array( 'tag_closers' => 'visit' ) );
$this->assertSame( 'content-2', $p->get_attribute( 'class' ) );
$p->next_tag( array( 'tag_closers' => 'visit' ) );
$result = $p->append_content_after_template_tag_closer( $content_3 );
$this->assertTrue( $result );
$p->next_tag( array( 'tag_closers' => 'visit' ) );
- $this->assertEquals( $content_1 . $content_2 . $content_3, $p );
+ $this->assertSame( $content_1 . $content_2 . $content_3, $p->get_updated_html() );
$this->assertSame( 'content-3', $p->get_attribute( 'class' ) );
}
@@ -507,7 +507,7 @@ public function test_append_content_after_template_tag_closer_in_the_middle_of_t
$p->next_tag( array( 'tag_closers' => 'visit' ) );
$result = $p->append_content_after_template_tag_closer( $content_2 );
$this->assertTrue( $result );
- $this->assertEquals( $content_1 . $content_2 . $content_3, $p );
+ $this->assertSame( $content_1 . $content_2 . $content_3, $p->get_updated_html() );
$p->next_tag( array( 'tag_closers' => 'visit' ) );
$this->assertSame( 'content-3', $p->get_attribute( 'class' ) );
@@ -516,7 +516,7 @@ public function test_append_content_after_template_tag_closer_in_the_middle_of_t
$p->next_tag( array( 'tag_closers' => 'visit' ) );
$result = $p->append_content_after_template_tag_closer( $content_4 );
$this->assertTrue( $result );
- $this->assertEquals( $content_1 . $content_4 . $content_3, $p );
+ $this->assertSame( $content_1 . $content_4 . $content_3, $p->get_updated_html() );
$p->next_tag( array( 'tag_closers' => 'visit' ) );
$this->assertSame( 'content-4', $p->get_attribute( 'class' ) );
}
@@ -535,7 +535,7 @@ public function test_append_content_after_template_tag_closer_on_opener_tag() {
$p->next_tag( array( 'tag_closers' => 'visit' ) );
$result = $p->append_content_after_template_tag_closer( 'New text' );
$this->assertFalse( $result );
- $this->assertEquals( $content, $p );
+ $this->assertSame( $content, $p->get_updated_html() );
}
/**
@@ -556,7 +556,7 @@ public function test_append_content_after_template_tag_closer_multiple_calls_in_
$p->next_tag( array( 'tag_closers' => 'visit' ) );
$result = $p->append_content_after_template_tag_closer( $content_2 );
$this->assertTrue( $result );
- $this->assertEquals( $content_1 . $content_2, $p );
+ $this->assertSame( $content_1 . $content_2, $p->get_updated_html() );
$p->next_tag( array( 'tag_closers' => 'visit' ) );
$this->assertSame( 'content-2', $p->get_attribute( 'class' ) );
// Rewinds to the first template.
@@ -565,7 +565,7 @@ public function test_append_content_after_template_tag_closer_multiple_calls_in_
$this->assertSame( 'content-1', $p->get_attribute( 'class' ) );
$p->next_tag( array( 'tag_closers' => 'visit' ) );
$result = $p->append_content_after_template_tag_closer( $content_3 );
- $this->assertEquals( $content_1 . $content_3 . $content_2, $p );
+ $this->assertSame( $content_1 . $content_3 . $content_2, $p->get_updated_html() );
$p->next_tag( array( 'tag_closers' => 'visit' ) );
$this->assertSame( 'content-3', $p->get_attribute( 'class' ) );
}
@@ -588,7 +588,7 @@ public function test_append_content_after_template_tag_closer_with_set_attribute
$p->next_tag( array( 'tag_closers' => 'visit' ) );
$result = $p->append_content_after_template_tag_closer( $content_2 );
$this->assertTrue( $result );
- $this->assertEquals( '
Text' . $content_2, $p );
+ $this->assertSame( '
Text' . $content_2, $p->get_updated_html() );
}
/**
@@ -613,7 +613,7 @@ public function test_append_content_after_template_tag_closer_with_existing_tags
);
$result = $p->append_content_after_template_tag_closer( $content_2 );
$this->assertTrue( $result );
- $this->assertEquals( $content_1 . $content_2, $p );
+ $this->assertSame( $content_1 . $content_2, $p->get_updated_html() );
$p->next_tag();
$this->assertSame( 'content-2-template-1', $p->get_attribute( 'class' ) );
$p->next_tag();
@@ -621,7 +621,7 @@ public function test_append_content_after_template_tag_closer_with_existing_tags
$p->next_tag( array( 'tag_closers' => 'visit' ) );
$result = $p->append_content_after_template_tag_closer( $content_3 );
$this->assertTrue( $result );
- $this->assertEquals( $content_1 . '
New text' . $content_3 . '', $p );
+ $this->assertSame( $content_1 . '
New text' . $content_3 . '', $p->get_updated_html() );
}
/**
@@ -639,7 +639,7 @@ public function test_append_content_after_template_tag_closer_empty() {
$p->next_tag( array( 'tag_closers' => 'visit' ) );
$result = $p->append_content_after_template_tag_closer( '' );
$this->assertFalse( $result );
- $this->assertEquals( $content, $p );
+ $this->assertSame( $content, $p->get_updated_html() );
$this->assertSame( 'TEMPLATE', $p->get_tag() ); // It didn't move.
$this->assertTrue( $p->is_tag_closer() ); // It didn't move.
}
@@ -659,7 +659,7 @@ public function test_append_content_after_template_tag_closer_non_existent_tag()
$p->next_tag();
$result = $p->append_content_after_template_tag_closer( $content_2 );
$this->assertFalse( $result );
- $this->assertEquals( $content_1, $p );
+ $this->assertSame( $content_1, $p->get_updated_html() );
}
/**
@@ -678,7 +678,7 @@ public function test_append_content_after_template_tag_closer_non_template_tags(
$p->next_tag( array( 'tag_closers' => 'visit' ) );
$result = $p->append_content_after_template_tag_closer( $content_2 );
$this->assertFalse( $result );
- $this->assertEquals( $content_1, $p );
+ $this->assertSame( $content_1, $p->get_updated_html() );
}
/**