Exemplo n.º 1
0
 public function testLocale()
 {
     $this->translatable->setLocales([$locale = 'fr_FR']);
     $this->translatable->setFallbackLocale('en_EN');
     $this->translatable->setTranslationFactory($translationFactory = $this->createFactoryMock());
     $translationFactory->expects($this->once())->method('create')->with($this->identicalTo(['locale' => $locale]))->will($this->returnValue($translation = $this->createTranslationMock()));
     $translation->expects($this->exactly(3))->method('getLocale')->will($this->returnValue($locale));
     $this->translatable->getTranslation(true);
     $this->assertSame($locale, $this->translatable->getLocale());
 }