In multi_resize() image editor methods, assert that null can only be passed for one of the arguments, not both. Add a lot more unit test assertions to ensure this.

Props pbearne, DH-Shredder.
Fixes #26823.



git-svn-id: https://develop.svn.wordpress.org/trunk@27794 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-03-27 20:39:08 +00:00
parent 75ee98cb25
commit 7b7e5305c7
6 changed files with 798 additions and 82 deletions

View File

@@ -82,13 +82,17 @@ abstract class WP_Image_Editor {
/**
* Resizes current image.
*
* At minimum, either a height or width must be provided.
* If one of the two is set to null, the resize will
* maintain aspect ratio according to the provided dimension.
*
* @since 3.5.0
* @access public
* @abstract
*
* @param int $max_w
* @param int $max_h
* @param boolean $crop
* @param int|null $max_w Image width.
* @param int|null $max_h Image height.
* @param boolean $crop
* @return boolean|WP_Error
*/
abstract public function resize( $max_w, $max_h, $crop = false );