Make WordPress Core

Changeset 25405


Ignore:
Timestamp:
09/12/2013 05:36:45 PM (11 years ago)
Author:
wonderboymusic
Message:

Fix the failing l10n assertions:

  • Check if the file exists before running true assertions
  • If the file doesn't exist, run false assertions

See #25282.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/l10n.php

    r25002 r25405  
    1010        $this->assertFalse( is_textdomain_loaded( 'wp-tests-domain' ) );
    1111        $this->assertFalse( unload_textdomain( 'wp-tests-domain' ) );
    12         $this->assertTrue( load_textdomain( 'wp-tests-domain', DIR_TESTDATA . '/wpcom-themes/p2/languages/es_ES.mo' ) );
    13         $this->assertTrue( is_textdomain_loaded( 'wp-tests-domain' ) );
    14         $this->assertTrue( unload_textdomain( 'wp-tests-domain' ) );
     12
     13        $file = DIR_TESTDATA . '/wpcom-themes/p2/languages/es_ES.mo';
     14        if ( file_exists( $file ) ) {
     15            $this->assertTrue( load_textdomain( 'wp-tests-domain', $file ) );
     16            $this->assertTrue( is_textdomain_loaded( 'wp-tests-domain' ) );
     17            $this->assertTrue( unload_textdomain( 'wp-tests-domain' ) );
     18        } else {
     19            $this->assertFalse( load_textdomain( 'wp-tests-domain', $file ) );
     20            $this->assertFalse( is_textdomain_loaded( 'wp-tests-domain' ) );
     21            $this->assertFalse( unload_textdomain( 'wp-tests-domain' ) );
     22        }
    1523        $this->assertFalse( is_textdomain_loaded( 'wp-tests-domain' ) );
    1624    }
Note: See TracChangeset for help on using the changeset viewer.