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

Merge branch 'fix/test' into 'master'

Fix fatal in test run under PHP 8

See merge request !18
parents 0fb67900 399afd8b
No related branches found
No related tags found
1 merge request!18Fix fatal in test run under PHP 8
Pipeline #4869 passed
......@@ -8,7 +8,7 @@
convertWarningsToExceptions="true"
>
<testsuites>
<testsuite>
<testsuite name="view-all-posts-pages">
<directory prefix="test-" suffix=".php">./tests/</directory>
<exclude>./tests/test-sample.php</exclude>
</testsuite>
......
......@@ -37,8 +37,8 @@ class PostFilters extends WP_UnitTestCase {
/**
* Prepare data for tests.
*/
public function setUp() {
parent::setUp();
public function set_up() {
parent::set_up();
static::$post_id = $this->factory->post->create(
array(
......@@ -128,7 +128,7 @@ class PostFilters extends WP_UnitTestCase {
$content = get_the_content();
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