Skip to content
Snippets Groups Projects

Fix fatal in test run under PHP 8

Merged Erick Hitter requested to merge fix/test into master
Files
2
@@ -37,8 +37,8 @@ class PostFilters extends WP_UnitTestCase {
@@ -37,8 +37,8 @@ class PostFilters extends WP_UnitTestCase {
/**
/**
* Prepare data for tests.
* Prepare data for tests.
*/
*/
public function setUp() {
public function set_up() {
parent::setUp();
parent::set_up();
static::$post_id = $this->factory->post->create(
static::$post_id = $this->factory->post->create(
array(
array(
@@ -128,7 +128,7 @@ class PostFilters extends WP_UnitTestCase {
@@ -128,7 +128,7 @@ class PostFilters extends WP_UnitTestCase {
$content = get_the_content();
$content = get_the_content();
foreach ( static::$pages_content as $page => $text ) {
foreach ( static::$pages_content as $page => $text ) {
$this->assertContains( $text, $content, "Failed to assert that content contained page {$page}." );
$this->assertStringContainsString( $text, $content, "Failed to assert that content contained page {$page}." );
}
}
}
}
}
}
Loading