Changeset 57755 for trunk/tests/phpunit/tests/image/siteIcon.php
- Timestamp:
- 03/02/2024 08:13:02 PM (2 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/image/siteIcon.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/siteIcon.php
r52010 r57755 99 99 } 100 100 101 public function test_create_attachment_object() {102 $attachment_id = $this->insert_attachment();103 $parent_url = get_post( $attachment_id )->guid;104 $cropped = str_replace( wp_basename( $parent_url ), 'cropped-test-image.jpg', $parent_url );105 106 $object = $this->wp_site_icon->create_attachment_object( $cropped, $attachment_id );107 108 $this->assertSame( $object['post_title'], 'cropped-test-image.jpg' );109 $this->assertSame( $object['context'], 'site-icon' );110 $this->assertSame( $object['post_mime_type'], 'image/jpeg' );111 $this->assertSame( $object['post_content'], $cropped );112 $this->assertSame( $object['guid'], $cropped );113 }114 115 101 public function test_insert_cropped_attachment() { 116 102 $attachment_id = $this->insert_attachment(); … … 118 104 $cropped = str_replace( wp_basename( $parent_url ), 'cropped-test-image.jpg', $parent_url ); 119 105 120 $object = $this->wp_site_icon->create_attachment_object( $cropped, $attachment_id);106 $object = wp_copy_parent_attachment_properties( $cropped, $attachment_id, 'site-icon' ); 121 107 $cropped_id = $this->wp_site_icon->insert_attachment( $object, $cropped ); 122 108
Note: See TracChangeset
for help on using the changeset viewer.