Changeset 52010 for trunk/tests/phpunit/tests/image/siteIcon.php
- Timestamp:
- 11/04/2021 03:22:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/siteIcon.php
r51568 r52010 13 13 public $attachment_id = 0; 14 14 15 function set_up() {15 public function set_up() { 16 16 parent::set_up(); 17 17 … … 19 19 } 20 20 21 function tear_down() {22 $this-> _remove_custom_logo();21 public function tear_down() { 22 $this->remove_custom_logo(); 23 23 $this->remove_added_uploads(); 24 24 parent::tear_down(); 25 25 } 26 26 27 function _remove_custom_logo() {27 private function remove_custom_logo() { 28 28 remove_theme_mod( 'custom_logo' ); 29 29 } 30 30 31 function test_intermediate_image_sizes() {31 public function test_intermediate_image_sizes() { 32 32 $image_sizes = $this->wp_site_icon->intermediate_image_sizes( array() ); 33 33 … … 40 40 } 41 41 42 function test_intermediate_image_sizes_with_filter() {43 add_filter( 'site_icon_image_sizes', array( $this, ' _custom_test_sizes' ) );42 public function test_intermediate_image_sizes_with_filter() { 43 add_filter( 'site_icon_image_sizes', array( $this, 'custom_test_sizes' ) ); 44 44 $image_sizes = $this->wp_site_icon->intermediate_image_sizes( array() ); 45 45 … … 58 58 unset( $this->wp_site_icon->site_icon_sizes[ array_search( 321, $this->wp_site_icon->site_icon_sizes, true ) ] ); 59 59 // Remove the filter we added. 60 remove_filter( 'site_icon_image_sizes', array( $this, ' _custom_test_sizes' ) );60 remove_filter( 'site_icon_image_sizes', array( $this, 'custom_test_sizes' ) ); 61 61 } 62 62 63 function test_additional_sizes() {63 public function test_additional_sizes() { 64 64 $image_sizes = $this->wp_site_icon->additional_sizes( array() ); 65 65 … … 76 76 } 77 77 78 function test_additional_sizes_with_filter() {79 add_filter( 'site_icon_image_sizes', array( $this, ' _custom_test_sizes' ) );78 public function test_additional_sizes_with_filter() { 79 add_filter( 'site_icon_image_sizes', array( $this, 'custom_test_sizes' ) ); 80 80 $image_sizes = $this->wp_site_icon->additional_sizes( array() ); 81 81 … … 99 99 } 100 100 101 function test_create_attachment_object() {102 $attachment_id = $this-> _insert_attachment();101 public function test_create_attachment_object() { 102 $attachment_id = $this->insert_attachment(); 103 103 $parent_url = get_post( $attachment_id )->guid; 104 104 $cropped = str_replace( wp_basename( $parent_url ), 'cropped-test-image.jpg', $parent_url ); … … 113 113 } 114 114 115 function test_insert_cropped_attachment() {116 $attachment_id = $this-> _insert_attachment();115 public function test_insert_cropped_attachment() { 116 $attachment_id = $this->insert_attachment(); 117 117 $parent_url = get_post( $attachment_id )->guid; 118 118 $cropped = str_replace( wp_basename( $parent_url ), 'cropped-test-image.jpg', $parent_url ); … … 125 125 } 126 126 127 function test_delete_attachment_data() {128 $attachment_id = $this-> _insert_attachment();127 public function test_delete_attachment_data() { 128 $attachment_id = $this->insert_attachment(); 129 129 update_option( 'site_icon', $attachment_id ); 130 130 … … 137 137 * @ticket 34368 138 138 */ 139 function test_get_post_metadata() {140 $attachment_id = $this-> _insert_attachment();139 public function test_get_post_metadata() { 140 $attachment_id = $this->insert_attachment(); 141 141 update_option( 'site_icon', $attachment_id ); 142 142 … … 150 150 } 151 151 152 function _custom_test_sizes( $sizes ) {152 public function custom_test_sizes( $sizes ) { 153 153 $sizes[] = 321; 154 154 … … 156 156 } 157 157 158 function _insert_attachment() {158 private function insert_attachment() { 159 159 if ( $this->attachment_id ) { 160 160 return $this->attachment_id;
Note: See TracChangeset
for help on using the changeset viewer.