Changeset 48937 for trunk/tests/phpunit/tests/image/editor.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/image/editor.php
r47198 r48937 75 75 76 76 // Check default value. 77 $this->assert Equals( 82, $editor->get_quality() );77 $this->assertSame( 82, $editor->get_quality() ); 78 78 79 79 // Ensure the quality filters do not have precedence if created after editor instantiation. 80 80 $func_100_percent = array( $this, 'return_integer_100' ); 81 81 add_filter( 'wp_editor_set_quality', $func_100_percent ); 82 $this->assert Equals( 82, $editor->get_quality() );82 $this->assertSame( 82, $editor->get_quality() ); 83 83 84 84 $func_95_percent = array( $this, 'return_integer_95' ); 85 85 add_filter( 'jpeg_quality', $func_95_percent ); 86 $this->assert Equals( 82, $editor->get_quality() );86 $this->assertSame( 82, $editor->get_quality() ); 87 87 88 88 // Ensure set_quality() works and overrides the filters. 89 89 $this->assertTrue( $editor->set_quality( 75 ) ); 90 $this->assert Equals( 75, $editor->get_quality() );90 $this->assertSame( 75, $editor->get_quality() ); 91 91 92 92 // Get a new editor to clear default quality state. … … 96 96 97 97 // Ensure jpeg_quality filter applies if it exists before editor instantiation. 98 $this->assert Equals( 95, $editor->get_quality() );98 $this->assertSame( 95, $editor->get_quality() ); 99 99 100 100 // Get a new editor to clear jpeg_quality state. … … 104 104 105 105 // Ensure wp_editor_set_quality filter applies if it exists before editor instantiation. 106 $this->assert Equals( 100, $editor->get_quality() );106 $this->assertSame( 100, $editor->get_quality() ); 107 107 108 108 // Clean up. … … 131 131 132 132 // Test with no parameters. 133 $this->assert Equals( 'canola-100x50.jpg', wp_basename( $editor->generate_filename() ) );133 $this->assertSame( 'canola-100x50.jpg', wp_basename( $editor->generate_filename() ) ); 134 134 135 135 // Test with a suffix only. 136 $this->assert Equals( 'canola-new.jpg', wp_basename( $editor->generate_filename( 'new' ) ) );136 $this->assertSame( 'canola-new.jpg', wp_basename( $editor->generate_filename( 'new' ) ) ); 137 137 138 138 // Test with a destination dir only. 139 $this->assert Equals( trailingslashit( realpath( get_temp_dir() ) ), trailingslashit( realpath( dirname( $editor->generate_filename( null, get_temp_dir() ) ) ) ) );139 $this->assertSame( trailingslashit( realpath( get_temp_dir() ) ), trailingslashit( realpath( dirname( $editor->generate_filename( null, get_temp_dir() ) ) ) ) ); 140 140 141 141 // Test with a suffix only. 142 $this->assert Equals( 'canola-100x50.png', wp_basename( $editor->generate_filename( null, null, 'png' ) ) );142 $this->assertSame( 'canola-100x50.png', wp_basename( $editor->generate_filename( null, null, 'png' ) ) ); 143 143 144 144 // Combo! 145 $this->assert Equals( trailingslashit( realpath( get_temp_dir() ) ) . 'canola-new.png', $editor->generate_filename( 'new', realpath( get_temp_dir() ), 'png' ) );145 $this->assertSame( trailingslashit( realpath( get_temp_dir() ) ) . 'canola-new.png', $editor->generate_filename( 'new', realpath( get_temp_dir() ), 'png' ) ); 146 146 } 147 147 … … 167 167 $property->setValue( $editor, $size ); 168 168 169 $this->assert Equals( $size, $editor->get_size() );169 $this->assertSame( $size, $editor->get_size() ); 170 170 } 171 171 … … 190 190 $property->setValue( $editor, $size ); 191 191 192 $this->assert Equals( '100x50', $editor->get_suffix() );192 $this->assertSame( '100x50', $editor->get_suffix() ); 193 193 } 194 194 }
Note: See TracChangeset
for help on using the changeset viewer.