mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
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
29 lines
1.1 KiB
PHP
29 lines
1.1 KiB
PHP
<?php
|
|
|
|
/**
|
|
* @group l10n
|
|
* @group i18n
|
|
*/
|
|
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' ) );
|
|
$this->assertFalse( is_textdomain_loaded( 'wp-tests-domain' ) );
|
|
}
|
|
|
|
/**
|
|
* @ticket 21319
|
|
*/
|
|
function test_is_textdomain_loaded_for_no_translations() {
|
|
$this->assertFalse( load_textdomain( 'wp-tests-domain', DIR_TESTDATA . '/non-existent-file' ) );
|
|
$this->assertFalse( is_textdomain_loaded( 'wp-tests-domain' ) );
|
|
$this->assertInstanceOf( 'NOOP_Translations', get_translations_for_domain( 'wp-tests-domain' ) );
|
|
// Ensure that we don't confuse NOOP_Translations to be a loaded text domain.
|
|
$this->assertFalse( is_textdomain_loaded( 'wp-tests-domain' ) );
|
|
$this->assertFalse( unload_textdomain( 'wp-tests-domain' ) );
|
|
}
|
|
} |