| @@ 105-114 (lines=10) @@ | ||
| 102 | * |
|
| 103 | * @param string $locale |
|
| 104 | */ |
|
| 105 | public function testSetTranslator($locale) |
|
| 106 | { |
|
| 107 | $t = new Translator($locale); |
|
| 108 | $t->addLoader('array', new ArrayLoader()); |
|
| 109 | Date::setTranslator($t); |
|
| 110 | ||
| 111 | $t = Date::getTranslator(); |
|
| 112 | $this->assertNotNull($t); |
|
| 113 | $this->assertSame($locale, $t->getLocale()); |
|
| 114 | } |
|
| 115 | ||
| 116 | public function testSetLocaleWithKnownLocale() |
|
| 117 | { |
|
| @@ 28-37 (lines=10) @@ | ||
| 25 | $this->assertSame('en', $t->getLocale()); |
|
| 26 | } |
|
| 27 | ||
| 28 | public function testSetTranslator() |
|
| 29 | { |
|
| 30 | $t = new Translator('fr'); |
|
| 31 | $t->addLoader('array', new ArrayLoader()); |
|
| 32 | Interval::setTranslator($t); |
|
| 33 | ||
| 34 | $t = Interval::getTranslator(); |
|
| 35 | $this->assertNotNull($t); |
|
| 36 | $this->assertSame('fr', $t->getLocale()); |
|
| 37 | } |
|
| 38 | ||
| 39 | public function testGetLocale() |
|
| 40 | { |
|