Move PHPUnit tests into a tests/phpunit directory.

wp-tests-config.php can/should reside in the root of a develop checkout. `phpunit` should be run from the root.

see #25088.


git-svn-id: https://develop.svn.wordpress.org/trunk@25165 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2013-08-29 18:39:34 +00:00
parent d34baebc1d
commit 8045afd81b
318 changed files with 36 additions and 39 deletions
@@ -0,0 +1,46 @@
<?php
/**
* @group image
* @group media
* @group upload
*/
class Tests_Image_Intermediate_Size extends WP_UnitTestCase {
function test_make_intermediate_size_no_size() {
$image = image_make_intermediate_size( DIR_TESTDATA . '/images/a2-small.jpg', 0, 0, false );
$this->assertFalse( $image );
}
function test_make_intermediate_size_width() {
if ( !function_exists( 'imagejpeg' ) )
$this->markTestSkipped( 'jpeg support unavailable' );
$image = image_make_intermediate_size( DIR_TESTDATA . '/images/a2-small.jpg', 100, 0, false );
$this->assertInternalType( 'array', $image );
}
function test_make_intermediate_size_height() {
if ( !function_exists( 'imagejpeg' ) )
$this->markTestSkipped( 'jpeg support unavailable' );
$image = image_make_intermediate_size( DIR_TESTDATA . '/images/a2-small.jpg', 0, 75, false );
$this->assertInternalType( 'array', $image );
}
function test_make_intermediate_size_successful() {
if ( !function_exists( 'imagejpeg' ) )
$this->markTestSkipped( 'jpeg support unavailable' );
$image = image_make_intermediate_size( DIR_TESTDATA . '/images/a2-small.jpg', 100, 75, true );
$this->assertInternalType( 'array', $image );
$this->assertEquals( 100, $image['width'] );
$this->assertEquals( 75, $image['height'] );
$this->assertEquals( 'image/jpeg', $image['mime-type'] );
$this->assertFalse( isset( $image['path'] ) );
}
}