Skip to content
Snippets Groups Projects
Commit 399afd8b authored by Erick Hitter's avatar Erick Hitter
Browse files

Fix fatal in test run under PHP 8

parent 0fb67900
Branches
Tags
1 merge request!18Fix fatal in test run under PHP 8
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
convertWarningsToExceptions="true" convertWarningsToExceptions="true"
> >
<testsuites> <testsuites>
<testsuite> <testsuite name="view-all-posts-pages">
<directory prefix="test-" suffix=".php">./tests/</directory> <directory prefix="test-" suffix=".php">./tests/</directory>
<exclude>./tests/test-sample.php</exclude> <exclude>./tests/test-sample.php</exclude>
</testsuite> </testsuite>
......
...@@ -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}." );
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment