From 59f15cdea9747e23ac05df09e993e314183ffc6d Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 17 Jul 2016 16:23:31 +0000 Subject: [PATCH] Unit Tests: Account for the string changes in [38077]. See #18218. git-svn-id: https://develop.svn.wordpress.org/trunk@38078 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/taxonomy.php | 2 +- tests/phpunit/tests/xmlrpc/wp/deleteTerm.php | 6 +++--- tests/phpunit/tests/xmlrpc/wp/editTerm.php | 6 +++--- tests/phpunit/tests/xmlrpc/wp/getTaxonomy.php | 4 ++-- tests/phpunit/tests/xmlrpc/wp/getTerm.php | 6 +++--- tests/phpunit/tests/xmlrpc/wp/getTerms.php | 4 ++-- tests/phpunit/tests/xmlrpc/wp/newTerm.php | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/phpunit/tests/taxonomy.php b/tests/phpunit/tests/taxonomy.php index ea84d7a777..4fa9550cf2 100644 --- a/tests/phpunit/tests/taxonomy.php +++ b/tests/phpunit/tests/taxonomy.php @@ -254,7 +254,7 @@ class Tests_Taxonomy extends WP_UnitTestCase { public function test_get_objects_in_term_should_return_invalid_taxonomy_error() { $terms = get_objects_in_term( 1, 'invalid_taxonomy' ); $this->assertInstanceOf( 'WP_Error', $terms ); - $this->assertEquals( 'Invalid taxonomy', $terms->get_error_message() ); + $this->assertEquals( 'invalid_taxonomy', $terms->get_error_code() ); } public function test_get_objects_in_term_should_return_empty_array() { diff --git a/tests/phpunit/tests/xmlrpc/wp/deleteTerm.php b/tests/phpunit/tests/xmlrpc/wp/deleteTerm.php index dff7b63264..6f738b1177 100644 --- a/tests/phpunit/tests/xmlrpc/wp/deleteTerm.php +++ b/tests/phpunit/tests/xmlrpc/wp/deleteTerm.php @@ -25,7 +25,7 @@ class Tests_XMLRPC_wp_deleteTerm extends WP_XMLRPC_UnitTestCase { $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'subscriber', 'subscriber', '', 0 ) ); $this->assertInstanceOf( 'IXR_Error', $result ); $this->assertEquals( 403, $result->code ); - $this->assertEquals( __( 'Invalid taxonomy' ), $result->message ); + $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message ); } function test_invalid_taxonomy() { @@ -34,7 +34,7 @@ class Tests_XMLRPC_wp_deleteTerm extends WP_XMLRPC_UnitTestCase { $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'subscriber', 'subscriber', 'not_existing', 0 ) ); $this->assertInstanceOf( 'IXR_Error', $result ); $this->assertEquals( 403, $result->code ); - $this->assertEquals( __( 'Invalid taxonomy' ), $result->message ); + $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message ); } function test_incapable_user() { @@ -61,7 +61,7 @@ class Tests_XMLRPC_wp_deleteTerm extends WP_XMLRPC_UnitTestCase { $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'editor', 'editor', 'category', 9999 ) ); $this->assertInstanceOf( 'IXR_Error', $result ); $this->assertEquals( 404, $result->code ); - $this->assertEquals( __('Invalid term ID'), $result->message ); + $this->assertEquals( __( 'Invalid term ID.' ), $result->message ); } function test_term_deleted() { diff --git a/tests/phpunit/tests/xmlrpc/wp/editTerm.php b/tests/phpunit/tests/xmlrpc/wp/editTerm.php index 42ae40d359..af8bd0bef9 100644 --- a/tests/phpunit/tests/xmlrpc/wp/editTerm.php +++ b/tests/phpunit/tests/xmlrpc/wp/editTerm.php @@ -31,7 +31,7 @@ class Tests_XMLRPC_wp_editTerm extends WP_XMLRPC_UnitTestCase { $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', '', array( 'taxonomy' => '' ) ) ); $this->assertInstanceOf( 'IXR_Error', $result ); $this->assertEquals( 403, $result->code ); - $this->assertEquals( __( 'Invalid taxonomy' ), $result->message ); + $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message ); } function test_invalid_taxonomy() { @@ -40,7 +40,7 @@ class Tests_XMLRPC_wp_editTerm extends WP_XMLRPC_UnitTestCase { $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'subscriber', 'subscriber', $this->parent_term['term_id'], array( 'taxonomy' => 'not_existing' ) ) ); $this->assertInstanceOf( 'IXR_Error', $result ); $this->assertEquals( 403, $result->code ); - $this->assertEquals( __( 'Invalid taxonomy' ), $result->message ); + $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message ); } function test_incapable_user() { @@ -58,7 +58,7 @@ class Tests_XMLRPC_wp_editTerm extends WP_XMLRPC_UnitTestCase { $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', 9999, array( 'taxonomy' => 'category' ) ) ); $this->assertInstanceOf( 'IXR_Error', $result ); $this->assertEquals( 404, $result->code ); - $this->assertEquals( __( 'Invalid term ID' ), $result->message ); + $this->assertEquals( __( 'Invalid term ID.' ), $result->message ); } function test_empty_term() { diff --git a/tests/phpunit/tests/xmlrpc/wp/getTaxonomy.php b/tests/phpunit/tests/xmlrpc/wp/getTaxonomy.php index 2d40556a2b..f8446bcbf9 100644 --- a/tests/phpunit/tests/xmlrpc/wp/getTaxonomy.php +++ b/tests/phpunit/tests/xmlrpc/wp/getTaxonomy.php @@ -17,7 +17,7 @@ class Tests_XMLRPC_wp_getTaxonomy extends WP_XMLRPC_UnitTestCase { $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'editor', 'editor', '' ) ); $this->assertInstanceOf( 'IXR_Error', $result ); $this->assertEquals( 403, $result->code ); - $this->assertEquals( __( 'Invalid taxonomy' ), $result->message ); + $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message ); } function test_invalid_taxonomy() { @@ -26,7 +26,7 @@ class Tests_XMLRPC_wp_getTaxonomy extends WP_XMLRPC_UnitTestCase { $result = $this->myxmlrpcserver->wp_getTaxonomy( array( 1, 'editor', 'editor', 'not_existing' ) ); $this->assertInstanceOf( 'IXR_Error', $result ); $this->assertEquals( 403, $result->code ); - $this->assertEquals( __( 'Invalid taxonomy' ), $result->message ); + $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message ); } function test_incapable_user() { diff --git a/tests/phpunit/tests/xmlrpc/wp/getTerm.php b/tests/phpunit/tests/xmlrpc/wp/getTerm.php index 5dbe2a838e..3e7257b37b 100644 --- a/tests/phpunit/tests/xmlrpc/wp/getTerm.php +++ b/tests/phpunit/tests/xmlrpc/wp/getTerm.php @@ -25,7 +25,7 @@ class Tests_XMLRPC_wp_getTerm extends WP_XMLRPC_UnitTestCase { $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', '', 0 ) ); $this->assertInstanceOf( 'IXR_Error', $result ); $this->assertEquals( 403, $result->code ); - $this->assertEquals( __( 'Invalid taxonomy' ), $result->message ); + $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message ); } function test_invalid_taxonomy() { @@ -34,7 +34,7 @@ class Tests_XMLRPC_wp_getTerm extends WP_XMLRPC_UnitTestCase { $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'not_existing', 0 ) ); $this->assertInstanceOf( 'IXR_Error', $result ); $this->assertEquals( 403, $result->code ); - $this->assertEquals( __( 'Invalid taxonomy' ), $result->message ); + $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message ); } function test_incapable_user() { @@ -62,7 +62,7 @@ class Tests_XMLRPC_wp_getTerm extends WP_XMLRPC_UnitTestCase { $result = $this->myxmlrpcserver->wp_getTerm( array( 1, 'editor', 'editor', 'category', 9999 ) ); $this->assertInstanceOf( 'IXR_Error', $result ); $this->assertEquals( 404, $result->code ); - $this->assertEquals( __('Invalid term ID'), $result->message ); + $this->assertEquals( __( 'Invalid term ID.' ), $result->message ); } function test_valid_term() { diff --git a/tests/phpunit/tests/xmlrpc/wp/getTerms.php b/tests/phpunit/tests/xmlrpc/wp/getTerms.php index a3e3045498..e5c633615f 100644 --- a/tests/phpunit/tests/xmlrpc/wp/getTerms.php +++ b/tests/phpunit/tests/xmlrpc/wp/getTerms.php @@ -17,7 +17,7 @@ class Tests_XMLRPC_wp_getTerms extends WP_XMLRPC_UnitTestCase { $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', '' ) ); $this->assertInstanceOf( 'IXR_Error', $result ); $this->assertEquals( 403, $result->code ); - $this->assertEquals( __( 'Invalid taxonomy' ), $result->message ); + $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message ); } function test_invalid_taxonomy() { @@ -26,7 +26,7 @@ class Tests_XMLRPC_wp_getTerms extends WP_XMLRPC_UnitTestCase { $result = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'not_existing' ) ); $this->assertInstanceOf( 'IXR_Error', $result ); $this->assertEquals( 403, $result->code ); - $this->assertEquals( __( 'Invalid taxonomy' ), $result->message ); + $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message ); } function test_incapable_user() { diff --git a/tests/phpunit/tests/xmlrpc/wp/newTerm.php b/tests/phpunit/tests/xmlrpc/wp/newTerm.php index cbc6c1f8c5..d143936bb6 100644 --- a/tests/phpunit/tests/xmlrpc/wp/newTerm.php +++ b/tests/phpunit/tests/xmlrpc/wp/newTerm.php @@ -26,7 +26,7 @@ class Tests_XMLRPC_wp_newTerm extends WP_XMLRPC_UnitTestCase { $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => '' ) ) ); $this->assertInstanceOf( 'IXR_Error', $result ); $this->assertEquals( 403, $result->code ); - $this->assertEquals( __( 'Invalid taxonomy' ), $result->message ); + $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message ); } function test_invalid_taxonomy() { @@ -35,7 +35,7 @@ class Tests_XMLRPC_wp_newTerm extends WP_XMLRPC_UnitTestCase { $result = $this->myxmlrpcserver->wp_newTerm( array( 1, 'editor', 'editor', array( 'taxonomy' => 'not_existing' ) ) ); $this->assertInstanceOf( 'IXR_Error', $result ); $this->assertEquals( 403, $result->code ); - $this->assertEquals( __( 'Invalid taxonomy' ), $result->message ); + $this->assertEquals( __( 'Invalid taxonomy.' ), $result->message ); } function test_incapable_user() {