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

Merge branch 'fix/unit-tests' into 'master'

Fix tests for PHPUnit 9

See merge request !17
parents 1d306949 28a8b444
Branches
Tags
1 merge request!17Fix tests for PHPUnit 9
Pipeline #4777 passed
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
convertWarningsToExceptions="true" convertWarningsToExceptions="true"
> >
<testsuites> <testsuites>
<testsuite> <testsuite name="wp-revisions-control">
<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>
......
...@@ -38,7 +38,7 @@ class TestUI extends WP_UnitTestCase { ...@@ -38,7 +38,7 @@ class TestUI extends WP_UnitTestCase {
WP_Revisions_Control::get_instance()->revisions_meta_box( get_post( $post_id ) ); WP_Revisions_Control::get_instance()->revisions_meta_box( get_post( $post_id ) );
$meta_box = ob_get_clean(); $meta_box = ob_get_clean();
$this->assertContains( $this->assertStringContainsString(
'value=""', 'value=""',
$meta_box, $meta_box,
'Failed to assert that meta box has no value when no setting exists.' 'Failed to assert that meta box has no value when no setting exists.'
...@@ -56,7 +56,7 @@ class TestUI extends WP_UnitTestCase { ...@@ -56,7 +56,7 @@ class TestUI extends WP_UnitTestCase {
WP_Revisions_Control::get_instance()->revisions_meta_box( get_post( $post_id ) ); WP_Revisions_Control::get_instance()->revisions_meta_box( get_post( $post_id ) );
$meta_box = ob_get_clean(); $meta_box = ob_get_clean();
$this->assertContains( $this->assertStringContainsString(
'value=""', 'value=""',
$meta_box, $meta_box,
'Failed to assert that meta box has no value when no limit exists.' 'Failed to assert that meta box has no value when no limit exists.'
...@@ -78,7 +78,7 @@ class TestUI extends WP_UnitTestCase { ...@@ -78,7 +78,7 @@ class TestUI extends WP_UnitTestCase {
$name_format = 'name="%1$s[%2$s]"'; $name_format = 'name="%1$s[%2$s]"';
$value_format = 'value=""'; $value_format = 'value=""';
$this->assertContains( $this->assertStringContainsString(
sprintf( sprintf(
$name_format, $name_format,
static::$settings_section, static::$settings_section,
...@@ -88,7 +88,7 @@ class TestUI extends WP_UnitTestCase { ...@@ -88,7 +88,7 @@ class TestUI extends WP_UnitTestCase {
'Failed to assert that post field had correct name for post type.' 'Failed to assert that post field had correct name for post type.'
); );
$this->assertContains( $this->assertStringContainsString(
sprintf( sprintf(
$name_format, $name_format,
static::$settings_section, static::$settings_section,
...@@ -98,13 +98,13 @@ class TestUI extends WP_UnitTestCase { ...@@ -98,13 +98,13 @@ class TestUI extends WP_UnitTestCase {
'Failed to assert that page field had correct name for post type.' 'Failed to assert that page field had correct name for post type.'
); );
$this->assertContains( $this->assertStringContainsString(
$value_format, $value_format,
$post_field, $post_field,
'Failed to assert that post field had correct value.' 'Failed to assert that post field had correct value.'
); );
$this->assertContains( $this->assertStringContainsString(
$value_format, $value_format,
$page_field, $page_field,
'Failed to assert that page field had correct value.' 'Failed to assert that page field had correct value.'
...@@ -131,7 +131,7 @@ class TestUI extends WP_UnitTestCase { ...@@ -131,7 +131,7 @@ class TestUI extends WP_UnitTestCase {
$name_format = 'name="%1$s[%2$s]"'; $name_format = 'name="%1$s[%2$s]"';
$value_format = 'value="%1$s"'; $value_format = 'value="%1$s"';
$this->assertContains( $this->assertStringContainsString(
sprintf( sprintf(
$name_format, $name_format,
static::$settings_section, static::$settings_section,
...@@ -141,7 +141,7 @@ class TestUI extends WP_UnitTestCase { ...@@ -141,7 +141,7 @@ class TestUI extends WP_UnitTestCase {
'Failed to assert that post field had correct name for post type.' 'Failed to assert that post field had correct name for post type.'
); );
$this->assertContains( $this->assertStringContainsString(
sprintf( sprintf(
$value_format, $value_format,
$value $value
...@@ -171,7 +171,7 @@ class TestUI extends WP_UnitTestCase { ...@@ -171,7 +171,7 @@ class TestUI extends WP_UnitTestCase {
$name_format = 'name="%1$s[%2$s]"'; $name_format = 'name="%1$s[%2$s]"';
$value_format = 'value=""'; $value_format = 'value=""';
$this->assertContains( $this->assertStringContainsString(
sprintf( sprintf(
$name_format, $name_format,
static::$settings_section, static::$settings_section,
...@@ -181,7 +181,7 @@ class TestUI extends WP_UnitTestCase { ...@@ -181,7 +181,7 @@ class TestUI extends WP_UnitTestCase {
'Failed to assert that post field had correct name for post type.' 'Failed to assert that post field had correct name for post type.'
); );
$this->assertContains( $this->assertStringContainsString(
$value_format, $value_format,
$post_field, $post_field,
'Failed to assert that post field had correct value.' 'Failed to assert that post field had correct value.'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment