Build/Test Tools: Remove unnecessary checks and skips that should instead cause failures if they ever fail.
See #40533 git-svn-id: https://develop.svn.wordpress.org/trunk@40533 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
669bd1bbc3
commit
c0910cd442
@ -61,9 +61,6 @@ class Tests_Functions extends WP_UnitTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function test_path_is_absolute() {
|
function test_path_is_absolute() {
|
||||||
if ( !is_callable('path_is_absolute') )
|
|
||||||
$this->markTestSkipped();
|
|
||||||
|
|
||||||
$absolute_paths = array(
|
$absolute_paths = array(
|
||||||
'/',
|
'/',
|
||||||
'/foo/',
|
'/foo/',
|
||||||
@ -81,9 +78,6 @@ class Tests_Functions extends WP_UnitTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function test_path_is_not_absolute() {
|
function test_path_is_not_absolute() {
|
||||||
if ( !is_callable('path_is_absolute') )
|
|
||||||
$this->markTestSkipped();
|
|
||||||
|
|
||||||
$relative_paths = array(
|
$relative_paths = array(
|
||||||
'',
|
'',
|
||||||
'.',
|
'.',
|
||||||
|
@ -8,9 +8,6 @@
|
|||||||
class Tests_Image_Size extends WP_UnitTestCase {
|
class Tests_Image_Size extends WP_UnitTestCase {
|
||||||
|
|
||||||
function test_constrain_dims_zero() {
|
function test_constrain_dims_zero() {
|
||||||
if (!is_callable('wp_constrain_dimensions'))
|
|
||||||
$this->markTestSkipped('wp_constrain_dimensions() is not callable.');
|
|
||||||
|
|
||||||
// no constraint - should have no effect
|
// no constraint - should have no effect
|
||||||
$out = wp_constrain_dimensions(640, 480, 0, 0);
|
$out = wp_constrain_dimensions(640, 480, 0, 0);
|
||||||
$this->assertSame( array( 640, 480 ), $out );
|
$this->assertSame( array( 640, 480 ), $out );
|
||||||
@ -26,9 +23,6 @@ class Tests_Image_Size extends WP_UnitTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function test_constrain_dims_smaller() {
|
function test_constrain_dims_smaller() {
|
||||||
if (!is_callable('wp_constrain_dimensions'))
|
|
||||||
$this->markTestSkipped('wp_constrain_dimensions() is not callable.');
|
|
||||||
|
|
||||||
// image size is smaller than the constraint - no effect
|
// image size is smaller than the constraint - no effect
|
||||||
$out = wp_constrain_dimensions(500, 600, 1024, 768);
|
$out = wp_constrain_dimensions(500, 600, 1024, 768);
|
||||||
$this->assertSame( array( 500, 600 ), $out );
|
$this->assertSame( array( 500, 600 ), $out );
|
||||||
@ -41,9 +35,6 @@ class Tests_Image_Size extends WP_UnitTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function test_constrain_dims_equal() {
|
function test_constrain_dims_equal() {
|
||||||
if (!is_callable('wp_constrain_dimensions'))
|
|
||||||
$this->markTestSkipped('wp_constrain_dimensions() is not callable.');
|
|
||||||
|
|
||||||
// image size is equal to the constraint - no effect
|
// image size is equal to the constraint - no effect
|
||||||
$out = wp_constrain_dimensions(1024, 768, 1024, 768);
|
$out = wp_constrain_dimensions(1024, 768, 1024, 768);
|
||||||
$this->assertSame( array( 1024, 768 ), $out );
|
$this->assertSame( array( 1024, 768 ), $out );
|
||||||
@ -56,9 +47,6 @@ class Tests_Image_Size extends WP_UnitTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function test_constrain_dims_larger() {
|
function test_constrain_dims_larger() {
|
||||||
if (!is_callable('wp_constrain_dimensions'))
|
|
||||||
$this->markTestSkipped('wp_constrain_dimensions() is not callable.');
|
|
||||||
|
|
||||||
// image size is larger than the constraint - result should be constrained
|
// image size is larger than the constraint - result should be constrained
|
||||||
$out = wp_constrain_dimensions(1024, 768, 500, 600);
|
$out = wp_constrain_dimensions(1024, 768, 500, 600);
|
||||||
$this->assertSame( array( 500, 375 ), $out );
|
$this->assertSame( array( 500, 375 ), $out );
|
||||||
@ -81,9 +69,6 @@ class Tests_Image_Size extends WP_UnitTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function test_constrain_dims_boundary() {
|
function test_constrain_dims_boundary() {
|
||||||
if (!is_callable('wp_constrain_dimensions'))
|
|
||||||
$this->markTestSkipped('wp_constrain_dimensions() is not callable.');
|
|
||||||
|
|
||||||
// one dimension is larger than the constraint, one smaller - result should be constrained
|
// one dimension is larger than the constraint, one smaller - result should be constrained
|
||||||
$out = wp_constrain_dimensions(1024, 768, 500, 800);
|
$out = wp_constrain_dimensions(1024, 768, 500, 800);
|
||||||
$this->assertSame( array( 500, 375 ), $out );
|
$this->assertSame( array( 500, 375 ), $out );
|
||||||
|
Loading…
Reference in New Issue
Block a user