- Timestamp:
- 05/29/2023 08:34:43 AM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php
r54669 r55865 123 123 124 124 /** 125 * @ticket 58321 126 * 127 * @covers ::get_translations_for_domain 128 */ 129 public function test_get_translations_for_domain_get_locale_is_called_only_once() { 130 $filter_locale = new MockAction(); 131 add_filter( 'locale', array( $filter_locale, 'filter' ) ); 132 133 get_translations_for_domain( 'internationalized-plugin' ); 134 get_translations_for_domain( 'internationalized-plugin' ); 135 get_translations_for_domain( 'internationalized-plugin' ); 136 $translations = get_translations_for_domain( 'internationalized-plugin' ); 137 138 remove_filter( 'locale', array( $filter_locale, 'filter' ) ); 139 140 $this->assertSame( 1, $filter_locale->get_call_count() ); 141 $this->assertInstanceOf( 'NOOP_Translations', $translations ); 142 $this->assertFalse( is_textdomain_loaded( 'internationalized-plugin' ) ); 143 } 144 145 /** 125 146 * @ticket 37113 126 147 *
Note: See TracChangeset
for help on using the changeset viewer.