Changeset 30702
- Timestamp:
- 12/02/2014 03:43:17 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/meta.php
r30140 r30702 296 296 * @ticket 15030 297 297 */ 298 public function test_get_metadata_with_empty_key_array_value _should_be_unserialized() {298 public function test_get_metadata_with_empty_key_array_value() { 299 299 $data = array( 1, 2 ); 300 $value = serialize( $data ); 300 301 add_metadata( 'user', $this->author->ID, 'foo', $data ); 301 302 $found = get_metadata( 'user', $this->author->ID ); 302 303 303 $this->assertSame( array( $ data), $found['foo'] );304 $this->assertSame( array( $value ), $found['foo'] ); 304 305 } 305 306 … … 307 308 * @ticket 15030 308 309 */ 309 public function test_get_metadata_with_empty_key_object_value _should_be_unserialized() {310 public function test_get_metadata_with_empty_key_object_value() { 310 311 $data = new stdClass; 311 312 $data->foo = 'bar'; 313 $value = serialize( $data ); 312 314 add_metadata( 'user', $this->author->ID, 'foo', $data ); 313 315 $found = get_metadata( 'user', $this->author->ID ); 314 316 315 $this->assertEquals( array( $ data), $found['foo'] );317 $this->assertEquals( array( $value ), $found['foo'] ); 316 318 } 317 319 … … 319 321 * @ticket 15030 320 322 */ 321 public function test_get_metadata_with_empty_key_nested_array_value _should_be_unserialized() {323 public function test_get_metadata_with_empty_key_nested_array_value() { 322 324 $data = array( 323 325 array( 1, 2 ), 324 326 array( 3, 4 ), 325 327 ); 328 $value = serialize( $data ); 326 329 add_metadata( 'user', $this->author->ID, 'foo', $data ); 327 330 $found = get_metadata( 'user', $this->author->ID ); 328 331 329 $this->assertSame( array( $ data), $found['foo'] );332 $this->assertSame( array( $value ), $found['foo'] ); 330 333 } 331 334
Note: See TracChangeset
for help on using the changeset viewer.