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. git-svn-id: https://develop.svn.wordpress.org/trunk@25405 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
404fd85586
commit
8a2c79d897
@ -9,9 +9,17 @@ class Tests_L10n extends WP_UnitTestCase {
|
||||
function test_load_unload_textdomain() {
|
||||
$this->assertFalse( is_textdomain_loaded( 'wp-tests-domain' ) );
|
||||
$this->assertFalse( unload_textdomain( 'wp-tests-domain' ) );
|
||||
$this->assertTrue( load_textdomain( 'wp-tests-domain', DIR_TESTDATA . '/wpcom-themes/p2/languages/es_ES.mo' ) );
|
||||
$this->assertTrue( is_textdomain_loaded( 'wp-tests-domain' ) );
|
||||
$this->assertTrue( unload_textdomain( 'wp-tests-domain' ) );
|
||||
|
||||
$file = DIR_TESTDATA . '/wpcom-themes/p2/languages/es_ES.mo';
|
||||
if ( file_exists( $file ) ) {
|
||||
$this->assertTrue( load_textdomain( 'wp-tests-domain', $file ) );
|
||||
$this->assertTrue( is_textdomain_loaded( 'wp-tests-domain' ) );
|
||||
$this->assertTrue( unload_textdomain( 'wp-tests-domain' ) );
|
||||
} else {
|
||||
$this->assertFalse( load_textdomain( 'wp-tests-domain', $file ) );
|
||||
$this->assertFalse( is_textdomain_loaded( 'wp-tests-domain' ) );
|
||||
$this->assertFalse( unload_textdomain( 'wp-tests-domain' ) );
|
||||
}
|
||||
$this->assertFalse( is_textdomain_loaded( 'wp-tests-domain' ) );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user