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

Merge branch 'fix/tests' into 'master'

Fix tests for PHP 8

See merge request !13
parents 129c299f 2fb0575e
No related branches found
No related tags found
1 merge request!13Fix tests for PHP 8
Pipeline #4793 passed with stages
in 1 minute and 50 seconds
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
convertWarningsToExceptions="true" convertWarningsToExceptions="true"
> >
<testsuites> <testsuites>
<testsuite> <testsuite name="external-permalinks-redux">
<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>
......
...@@ -43,8 +43,8 @@ class AdminCallbacks extends WP_UnitTestCase { ...@@ -43,8 +43,8 @@ class AdminCallbacks extends WP_UnitTestCase {
/** /**
* Create some objects with redirects. * Create some objects with redirects.
*/ */
public function setUp() { public function set_up() {
parent::setUp(); parent::set_up();
$this->plugin = external_permalinks_redux::get_instance(); $this->plugin = external_permalinks_redux::get_instance();
...@@ -65,10 +65,10 @@ class AdminCallbacks extends WP_UnitTestCase { ...@@ -65,10 +65,10 @@ class AdminCallbacks extends WP_UnitTestCase {
$this->plugin->meta_box( get_post( $this->post_id ) ); $this->plugin->meta_box( get_post( $this->post_id ) );
$meta_box_contents = ob_get_clean(); $meta_box_contents = ob_get_clean();
$this->assertContains( 'value="' . $this->nonce . '"', $meta_box_contents ); $this->assertStringContainsString( 'value="' . $this->nonce . '"', $meta_box_contents );
foreach ( array_keys( $this->plugin->status_codes ) as $code ) { foreach ( array_keys( $this->plugin->status_codes ) as $code ) {
$this->assertContains( 'value="' . $code . '"', $meta_box_contents ); $this->assertStringContainsString( 'value="' . $code . '"', $meta_box_contents );
} }
} }
...@@ -82,7 +82,7 @@ class AdminCallbacks extends WP_UnitTestCase { ...@@ -82,7 +82,7 @@ class AdminCallbacks extends WP_UnitTestCase {
$this->plugin->action_save_post( $this->post_id ); $this->plugin->action_save_post( $this->post_id );
$this->assertEquals( static::DESTINATION, get_post_meta( $this->post_id, $this->plugin->meta_key_target, true ) ); $this->assertStringContainsString( static::DESTINATION, get_post_meta( $this->post_id, $this->plugin->meta_key_target, true ) );
$this->assertEquals( static::TYPE, get_post_meta( $this->post_id, $this->plugin->meta_key_type, true ) ); $this->assertStringContainsString( (string) static::TYPE, get_post_meta( $this->post_id, $this->plugin->meta_key_type, true ) );
} }
} }
...@@ -31,8 +31,8 @@ class PermalinkFilters extends WP_UnitTestCase { ...@@ -31,8 +31,8 @@ class PermalinkFilters extends WP_UnitTestCase {
/** /**
* Create some objects with redirects. * Create some objects with redirects.
*/ */
public function setUp() { public function set_up() {
parent::setUp(); parent::set_up();
$plugin = external_permalinks_redux::get_instance(); $plugin = external_permalinks_redux::get_instance();
......
...@@ -24,8 +24,8 @@ class RedirectCallbacks extends WP_UnitTestCase { ...@@ -24,8 +24,8 @@ class RedirectCallbacks extends WP_UnitTestCase {
/** /**
* Create some objects with redirects. * Create some objects with redirects.
*/ */
public function setUp() { public function set_up() {
parent::setUp(); parent::set_up();
$this->plugin = external_permalinks_redux::get_instance(); $this->plugin = external_permalinks_redux::get_instance();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment