Make WordPress Core


Ignore:
Timestamp:
11/25/2013 10:49:51 PM (11 years ago)
Author:
wonderboymusic
Message:

When setting WP_TESTS_FORCE_KNOWN_BUGS to true, it is preferable that some forced tests are still skipped when they call classes or functions that do not exist, producing fatal errors.

Fixes #26248.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/dependencies/scripts.php

    r25002 r26370  
    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 ) ) );
     
    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 ) ) );
Note: See TracChangeset for help on using the changeset viewer.