Changeset 53920
- Timestamp:
- 08/22/2022 07:50:15 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/media.php
r53795 r53920 1654 1654 $expected = trim( $expected, ' ,' ); 1655 1655 1656 foreach ( $intermediates as $int ) {1657 $image_url = wp_get_attachment_image_url( self::$large_id, $int );1658 $size_array = $this->get_image_size_array_from_meta( $image_meta, $int );1659 1660 if ( 'full' === $int ) {1656 foreach ( $intermediates as $int_size ) { 1657 $image_url = wp_get_attachment_image_url( self::$large_id, $int_size ); 1658 $size_array = $this->get_image_size_array_from_meta( $image_meta, $int_size ); 1659 1660 if ( 'full' === $int_size ) { 1661 1661 // Add the full size image. Expected to be in the srcset when the full size image is used as src. 1662 1662 $_expected = $uploads_dir_url . $image_meta['file'] . ' ' . $image_meta['width'] . 'w, ' . $expected; … … 1707 1707 $expected = trim( $expected, ' ,' ); 1708 1708 1709 foreach ( $intermediates as $int ) { 1710 $size_array = $this->get_image_size_array_from_meta( $image_meta, $int ); 1711 $image_url = wp_get_attachment_image_url( $id, $int ); 1712 1713 if ( 'full' === $int ) { 1709 foreach ( $intermediates as $int_size ) { 1710 $image_urls[ $int_size ] = wp_get_attachment_image_url( $id, $int_size ); 1711 } 1712 1713 // Remove the attachment. 1714 wp_delete_attachment( $id, true ); 1715 remove_filter( 'upload_dir', '_upload_dir_no_subdir' ); 1716 1717 foreach ( $intermediates as $int_size ) { 1718 $size_array = $this->get_image_size_array_from_meta( $image_meta, $int_size ); 1719 $image_url = $image_urls[ $int_size ]; 1720 1721 if ( 'full' === $int_size ) { 1714 1722 // Add the full size image. Expected to be in the srcset when the full size image is used as src. 1715 1723 $_expected = $uploads_dir_url . $image_meta['file'] . ' ' . $image_meta['width'] . 'w, ' . $expected; … … 1722 1730 } 1723 1731 1724 // Remove the attachment.1725 wp_delete_attachment( $id, true );1726 remove_filter( 'upload_dir', '_upload_dir_no_subdir' );1727 1732 } 1728 1733 … … 1797 1802 $image_meta['file'] = 'H:\home\wordpress\trunk/wp-content/uploads/' . $image_meta['file']; 1798 1803 1799 foreach ( $intermediates as $int ) {1800 $image_url = wp_get_attachment_image_url( self::$large_id, $int );1801 $size_array = $this->get_image_size_array_from_meta( $image_meta, $int );1802 1803 if ( 'full' === $int ) {1804 foreach ( $intermediates as $int_size ) { 1805 $image_url = wp_get_attachment_image_url( self::$large_id, $int_size ); 1806 $size_array = $this->get_image_size_array_from_meta( $image_meta, $int_size ); 1807 1808 if ( 'full' === $int_size ) { 1804 1809 // Add the full size image. Expected to be in the srcset when the full size image is used as src. 1805 1810 $_expected = $uploads_dir_url . $full_size_file . ' ' . $image_meta['width'] . 'w, ' . $expected;
Note: See TracChangeset
for help on using the changeset viewer.