|
@@ 88-100 (lines=13) @@
|
| 85 |
|
$this->assertSame('Spanish', Locale::getByLocale('es_US')->getNativeName()); |
| 86 |
|
} |
| 87 |
|
|
| 88 |
|
public function testGetBaseURLContainsDomainAndURLSegmentForNonDefaultLocale() |
| 89 |
|
{ |
| 90 |
|
// es_ES has a domain but is not the default locale for that domain |
| 91 |
|
$result = Locale::getByLocale('es_ES')->getBaseURL(); |
| 92 |
|
$this->assertContains('fluent.es', $result, "Locale's domain is in the URL"); |
| 93 |
|
$this->assertContains('/es/', $result, 'URL segment for non-default locale is in the URL'); |
| 94 |
|
|
| 95 |
|
// Turning off domain mode removes domain but not prefix |
| 96 |
|
FluentState::singleton()->setIsDomainMode(false); |
| 97 |
|
$result = Locale::getByLocale('es_ES')->getBaseURL(); |
| 98 |
|
$this->assertNotContains('fluent.es', $result, "Locale's domain is in the URL"); |
| 99 |
|
$this->assertContains('/es/', $result, 'URL segment for non-default locale is in the URL'); |
| 100 |
|
} |
| 101 |
|
|
| 102 |
|
public function testGetBaseURLOnlyContainsDomainForDefaultLocale() |
| 103 |
|
{ |
|
@@ 102-114 (lines=13) @@
|
| 99 |
|
$this->assertContains('/es/', $result, 'URL segment for non-default locale is in the URL'); |
| 100 |
|
} |
| 101 |
|
|
| 102 |
|
public function testGetBaseURLOnlyContainsDomainForDefaultLocale() |
| 103 |
|
{ |
| 104 |
|
// es_US has a domain and is the default |
| 105 |
|
$result = Locale::getByLocale('es_US')->getBaseURL(); |
| 106 |
|
$this->assertContains('fluent.es', $result, "Locale's domain is in the URL"); |
| 107 |
|
$this->assertNotContains('/es-usa/', $result, 'URL segment is not in the URL for default locales'); |
| 108 |
|
|
| 109 |
|
// When domain mode is turned off, prefix is now necessary |
| 110 |
|
FluentState::singleton()->setIsDomainMode(false); |
| 111 |
|
$result = Locale::getByLocale('es_US')->getBaseURL(); |
| 112 |
|
$this->assertNotContains('fluent.es', $result, "Domain not used"); |
| 113 |
|
$this->assertContains('/es-usa/', $result, 'URL Segment necessary for non-global default'); |
| 114 |
|
} |
| 115 |
|
|
| 116 |
|
public function testGetSiblings() |
| 117 |
|
{ |