Make WordPress Core

Ticket #26248: 26248.diff

File 26248.diff, 4.3 KB (added by wonderboymusic, 11 years ago)
  • tests/phpunit/tests/dependencies/scripts.php

     
    9797         * @ticket 22229
    9898         */
    9999        function test_json_encode_should_not_encode_special_literal_values() {
     100                if ( ! class_exists( 'WP_JS_Literal' ) ) {
     101                        $this->markTestSkipped( "WP_JS_Literal class doesn't exist" );
     102                }
     103
    100104                $literal = new WP_JS_Literal( 'baba()' );
    101105                $this->assertEquals( '{"x":baba()}', WP_JS_Literal::json_encode( array( 'x' => $literal ), array( $literal ) ) );
    102106        }
     
    105109         * @ticket 22229
    106110         */
    107111        function test_json_encode_should_not_encode_special_literal_values_with_dependencies() {
     112                if ( ! class_exists( 'WP_JS_Literal' ) ) {
     113                        $this->markTestSkipped( "WP_JS_Literal class doesn't exist" );
     114                }
     115               
    108116                $literal = new WP_JS_Literal( 'baba()', array( 'dep0', 'dep1' ) );
    109117                $this->assertEquals( '{"x":baba()}', WP_JS_Literal::json_encode( array( 'x' => $literal ), array( $literal ) ) );
    110118        }
  • tests/phpunit/tests/export/class-wp-export-query.php

     
    77 * @ticket 22435
    88 */
    99class Test_WP_Export_Query extends WP_UnitTestCase {
     10        function setUp() {
     11                if ( ! class_exists( 'WP_Export_Query' ) ) {
     12                        $this->markTestSkipped( "WP_Export_Query class doesn't exist" );
     13                }
     14
     15                parent::setUp();
     16        }
     17
    1018        function test_WP_Export_Query_should_be_initialized_with_an_array() {
    1119                $export = new WP_Export_Query( array( 'author' => 'all' ) );
    1220                $this->assertTrue( (bool) $export );
  • tests/phpunit/tests/export/functions.export.php

     
    77 * @ticket 22435
    88 */
    99class Test_WP_Export_Functions extends WP_UnitTestCase {
     10        function setUp() {
     11                if ( ! function_exists( 'wp_export' ) ) {
     12                        $this->markTestSkipped( "wp_export function doesn't exist" );
     13                }
     14
     15                parent::setUp();
     16        }
     17       
    1018        function test_wp_export_returns_wp_error_if_the_writer_throws_Export_exception() {
    1119                $this->assertTrue( is_wp_error( wp_export( array( 'writer' => 'Test_WP_Export_Stub_Writer_Throws_Export_Exception' ) ) ) );
    1220        }
  • tests/phpunit/tests/export/writers.php

     
    88 */
    99class Test_WP_Export_Writers extends WP_UnitTestCase {
    1010        function test_export_returner_returns_all_the_return_values() {
     11                if ( ! class_exists( 'WP_Export_Returner' ) ) {
     12                        $this->markTestSkipped( "WP_Export_Returner class doesn't exist" );
     13                }
    1114                $returner = new WP_Export_Returner( $this->get_x_formatter() );
    1215                $this->assertEquals( 'xxx' , $returner->export() );
    1316        }
  • tests/phpunit/tests/formatting/MapDeep.php

     
    44 * @ticket 22300
    55 */
    66class Tests_Formatting_MapDeep extends WP_UnitTestCase {
     7        function setUp() {
     8                if ( ! function_exists( 'map_deep' ) ) {
     9                        $this->markTestSkipped( "map_deep function doesn't exist" );
     10                }
     11
     12                parent::setUp();
     13        }
     14
    715        function test_map_deep_with_any_function_over_empty_array_should_return_empty_array() {
    816                $this->assertEquals( array(), map_deep( array( $this, 'return_baba' ), array() ) );
    917        }
  • tests/phpunit/tests/iterators.php

     
    44 * @ticket 22435
    55 */
    66class Test_WP_Post_IDs_Iterator extends WP_UnitTestCase {
     7        function setUp() {
     8                if ( ! class_exists( 'WP_Post_IDs_Iterator' ) ) {
     9                        $this->markTestSkipped( "WP_Post_IDs_Iterator class doesn't exist" );
     10                }
     11
     12                parent::setUp();
     13        }
     14
    715        function test_create() {
    816                new WP_Post_IDs_Iterator( array( 1, 2, 3 ) );
    917        }