|
@@ 151-162 (lines=12) @@
|
| 148 |
|
$this->assertNull($this->app->make('translatable.locales')['jp']); |
| 149 |
|
} |
| 150 |
|
|
| 151 |
|
public function test_add_language_locale() |
| 152 |
|
{ |
| 153 |
|
$this->app['config']->set('translatable.locales', [ |
| 154 |
|
'de', |
| 155 |
|
]); |
| 156 |
|
$this->app->make('translatable.locales')->load(); |
| 157 |
|
|
| 158 |
|
$this->assertTrue($this->app->make('translatable.locales')->has('de')); |
| 159 |
|
$this->assertFalse($this->app->make('translatable.locales')->has('en')); |
| 160 |
|
$this->app->make('translatable.locales')->add('en'); |
| 161 |
|
$this->assertTrue($this->app->make('translatable.locales')->has('en')); |
| 162 |
|
} |
| 163 |
|
|
| 164 |
|
public function test_offset_set_language_locale() |
| 165 |
|
{ |
|
@@ 164-175 (lines=12) @@
|
| 161 |
|
$this->assertTrue($this->app->make('translatable.locales')->has('en')); |
| 162 |
|
} |
| 163 |
|
|
| 164 |
|
public function test_offset_set_language_locale() |
| 165 |
|
{ |
| 166 |
|
$this->app['config']->set('translatable.locales', [ |
| 167 |
|
'de', |
| 168 |
|
]); |
| 169 |
|
$this->app->make('translatable.locales')->load(); |
| 170 |
|
|
| 171 |
|
$this->assertTrue($this->app->make('translatable.locales')->has('de')); |
| 172 |
|
$this->assertFalse($this->app->make('translatable.locales')->has('en')); |
| 173 |
|
$this->app->make('translatable.locales')[] = 'en'; |
| 174 |
|
$this->assertTrue($this->app->make('translatable.locales')->has('en')); |
| 175 |
|
} |
| 176 |
|
|
| 177 |
|
public function test_offset_set_country_locale() |
| 178 |
|
{ |
|
@@ 177-188 (lines=12) @@
|
| 174 |
|
$this->assertTrue($this->app->make('translatable.locales')->has('en')); |
| 175 |
|
} |
| 176 |
|
|
| 177 |
|
public function test_offset_set_country_locale() |
| 178 |
|
{ |
| 179 |
|
$this->app['config']->set('translatable.locales', [ |
| 180 |
|
'de', |
| 181 |
|
]); |
| 182 |
|
$this->app->make('translatable.locales')->load(); |
| 183 |
|
|
| 184 |
|
$this->assertTrue($this->app->make('translatable.locales')->has('de')); |
| 185 |
|
$this->assertFalse($this->app->make('translatable.locales')->has('de-AT')); |
| 186 |
|
$this->app->make('translatable.locales')['de'] = 'AT'; |
| 187 |
|
$this->assertTrue($this->app->make('translatable.locales')->has('de-AT')); |
| 188 |
|
} |
| 189 |
|
|
| 190 |
|
public function test_forget() |
| 191 |
|
{ |
|
@@ 190-202 (lines=13) @@
|
| 187 |
|
$this->assertTrue($this->app->make('translatable.locales')->has('de-AT')); |
| 188 |
|
} |
| 189 |
|
|
| 190 |
|
public function test_forget() |
| 191 |
|
{ |
| 192 |
|
$this->app['config']->set('translatable.locales', [ |
| 193 |
|
'de', |
| 194 |
|
'en', |
| 195 |
|
]); |
| 196 |
|
$this->app->make('translatable.locales')->load(); |
| 197 |
|
|
| 198 |
|
$this->assertTrue($this->app->make('translatable.locales')->has('de')); |
| 199 |
|
$this->assertTrue($this->app->make('translatable.locales')->has('en')); |
| 200 |
|
$this->app->make('translatable.locales')->forget('en'); |
| 201 |
|
$this->assertFalse($this->app->make('translatable.locales')->has('en')); |
| 202 |
|
} |
| 203 |
|
|
| 204 |
|
public function test_offset_unset() |
| 205 |
|
{ |
|
@@ 204-216 (lines=13) @@
|
| 201 |
|
$this->assertFalse($this->app->make('translatable.locales')->has('en')); |
| 202 |
|
} |
| 203 |
|
|
| 204 |
|
public function test_offset_unset() |
| 205 |
|
{ |
| 206 |
|
$this->app['config']->set('translatable.locales', [ |
| 207 |
|
'de', |
| 208 |
|
'en', |
| 209 |
|
]); |
| 210 |
|
$this->app->make('translatable.locales')->load(); |
| 211 |
|
|
| 212 |
|
$this->assertTrue($this->app->make('translatable.locales')->has('de')); |
| 213 |
|
$this->assertTrue($this->app->make('translatable.locales')->has('en')); |
| 214 |
|
unset($this->app->make('translatable.locales')['en']); |
| 215 |
|
$this->assertFalse($this->app->make('translatable.locales')->has('en')); |
| 216 |
|
} |
| 217 |
|
|
| 218 |
|
public function test_get_locale_separator_config() |
| 219 |
|
{ |