- Timestamp:
- 08/20/2016 05:34:13 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/taxonomy/getObjectTaxonomies.php
r38290 r38292 46 46 $this->assertSame( $expected, $found ); 47 47 } 48 49 /** 50 * @ticket 37368 51 */ 52 public function test_should_return_all_attachment_taxonomies_for_attachment_object_type() { 53 register_taxonomy( 'wptests_tax2', 'attachment:image' ); 54 55 $a = self::factory()->attachment->create_object( 'image.jpg', 0, array( 56 'post_mime_type' => 'image/jpeg', 57 'post_type' => 'attachment' 58 ) ); 59 $attachment = get_post( $a ); 60 61 $found = get_object_taxonomies( $attachment, 'names' ); 62 63 $this->assertSame( array( 'wptests_tax2' ), $found ); 64 } 65 66 /** 67 * @ticket 37368 68 */ 69 public function test_should_respect_output_objects_when_object_is_attachment() { 70 register_taxonomy( 'wptests_tax2', 'attachment:image' ); 71 72 $a = self::factory()->attachment->create_object( 'image.jpg', 0, array( 73 'post_mime_type' => 'image/jpeg', 74 'post_type' => 'attachment' 75 ) ); 76 $attachment = get_post( $a ); 77 78 $found = get_object_taxonomies( $attachment, 'objects' ); 79 80 $this->assertSame( array( 'wptests_tax2' ), array_keys( $found ) ); 81 $this->assertInternalType( 'object', $found['wptests_tax2'] ); 82 $this->assertSame( 'wptests_tax2', $found['wptests_tax2']->name ); 83 } 48 84 }
Note: See TracChangeset
for help on using the changeset viewer.