Changeset 43359 for trunk/tests/phpunit/tests/l10n.php
- Timestamp:
- 06/16/2018 12:44:46 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/l10n.php
r42343 r43359 54 54 55 55 $array = get_available_languages( DIR_TESTDATA . '/languages/' ); 56 $this->assertEquals( array( 'de_DE', 'en_GB', 'es_ES' ), $array );56 $this->assertEquals( array( 'de_DE', 'en_GB', 'es_ES', 'ja_JP' ), $array ); 57 57 } 58 58 … … 98 98 $this->assertContains( '<option value="de_DE" lang="de" selected=\'selected\' data-installed="1">Deutsch</option>', $actual ); 99 99 $this->assertContains( '<option value="it_IT" lang="it">Italiano</option>', $actual ); 100 $this->assertContains( '<option value="ja_JP" lang="ja">日本語</option>', $actual ); 100 101 } 101 102 … … 121 122 $this->assertContains( '<option value="de_DE" lang="de" selected=\'selected\' data-installed="1">Deutsch</option>', $actual ); 122 123 $this->assertContains( '<option value="it_IT" lang="it">Italiano</option>', $actual ); 124 $this->assertContains( '<option value="ja_JP" lang="ja">日本語</option>', $actual ); 123 125 } 124 126 … … 142 144 $this->assertContains( '<option value="de_DE" lang="de" data-installed="1">Deutsch</option>', $actual ); 143 145 $this->assertContains( '<option value="it_IT" lang="it">Italiano</option>', $actual ); 146 $this->assertContains( '<option value="ja_JP" lang="ja">日本語</option>', $actual ); 147 } 148 149 /** 150 * Add site default language to ja_JP in dropdown 151 */ 152 function test_wp_dropdown_languages_site_default_ja_JP() { 153 $args = array( 154 'id' => 'foo', 155 'name' => 'bar', 156 'languages' => array( 'ja_JP' ), 157 'translations' => $this->wp_dropdown_languages_filter(), 158 'selected' => 'ja_JP', 159 'echo' => false, 160 'show_option_site_default' => true, 161 ); 162 $actual = wp_dropdown_languages( $args ); 163 164 $this->assertContains( 'id="foo"', $actual ); 165 $this->assertContains( 'name="bar"', $actual ); 166 $this->assertContains( '<option value="site-default" data-installed="1">Site Default</option>', $actual ); 167 $this->assertContains( '<option value="" lang="en" data-installed="1">English (United States)</option>', $actual ); 168 $this->assertContains( '<option value="de_DE" lang="de">Deutsch</option>', $actual ); 169 $this->assertContains( '<option value="it_IT" lang="it">Italiano</option>', $actual ); 170 $this->assertContains( '<option value="ja_JP" lang="ja" selected=\'selected\' data-installed="1">日本語</option>', $actual ); 171 } 172 173 /** 174 * Select dropdown language from de_DE to ja_JP 175 */ 176 function test_wp_dropdown_languages_ja_JP_selected() { 177 $args = array( 178 'id' => 'foo', 179 'name' => 'bar', 180 'languages' => array( 'de_DE' ), 181 'translations' => $this->wp_dropdown_languages_filter(), 182 'selected' => 'ja_JP', 183 'echo' => false, 184 ); 185 $actual = wp_dropdown_languages( $args ); 186 187 $this->assertContains( 'id="foo"', $actual ); 188 $this->assertContains( 'name="bar"', $actual ); 189 $this->assertContains( '<option value="" lang="en" data-installed="1">English (United States)</option>', $actual ); 190 $this->assertContains( '<option value="de_DE" lang="de" data-installed="1">Deutsch</option>', $actual ); 191 $this->assertContains( '<option value="it_IT" lang="it">Italiano</option>', $actual ); 192 $this->assertContains( '<option value="ja_JP" lang="ja" selected=\'selected\'>日本語</option>', $actual ); 144 193 } 145 194 … … 161 210 'iso' => array( 'it', 'ita' ), 162 211 ), 212 'ja_JP' => array( 213 'language' => 'ja_JP', 214 'native_name' => '日本語', 215 'iso' => array( 'ja' ), 216 ), 163 217 ); 164 218 }
Note: See TracChangeset
for help on using the changeset viewer.