From 5cda7d6aed0a49ce4ed5a4af42c9ccdf72166248 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 2 Dec 2014 03:43:17 +0000 Subject: [PATCH] Update the tests for `get_metadata()` to reflect the revert in r30701. See #15030 git-svn-id: https://develop.svn.wordpress.org/trunk@30702 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/meta.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/tests/meta.php b/tests/phpunit/tests/meta.php index cd134cf2ee..00c5147ddd 100644 --- a/tests/phpunit/tests/meta.php +++ b/tests/phpunit/tests/meta.php @@ -295,38 +295,41 @@ class Tests_Meta extends WP_UnitTestCase { /** * @ticket 15030 */ - public function test_get_metadata_with_empty_key_array_value_should_be_unserialized() { + public function test_get_metadata_with_empty_key_array_value() { $data = array( 1, 2 ); + $value = serialize( $data ); add_metadata( 'user', $this->author->ID, 'foo', $data ); $found = get_metadata( 'user', $this->author->ID ); - $this->assertSame( array( $data ), $found['foo'] ); + $this->assertSame( array( $value ), $found['foo'] ); } /** * @ticket 15030 */ - public function test_get_metadata_with_empty_key_object_value_should_be_unserialized() { + public function test_get_metadata_with_empty_key_object_value() { $data = new stdClass; $data->foo = 'bar'; + $value = serialize( $data ); add_metadata( 'user', $this->author->ID, 'foo', $data ); $found = get_metadata( 'user', $this->author->ID ); - $this->assertEquals( array( $data ), $found['foo'] ); + $this->assertEquals( array( $value ), $found['foo'] ); } /** * @ticket 15030 */ - public function test_get_metadata_with_empty_key_nested_array_value_should_be_unserialized() { + public function test_get_metadata_with_empty_key_nested_array_value() { $data = array( array( 1, 2 ), array( 3, 4 ), ); + $value = serialize( $data ); add_metadata( 'user', $this->author->ID, 'foo', $data ); $found = get_metadata( 'user', $this->author->ID ); - $this->assertSame( array( $data ), $found['foo'] ); + $this->assertSame( array( $value ), $found['foo'] ); } /** Helpers **********************************************************/