public function testFacadeTranslate() { $translate = TranslateManager::get(); $this->assertSame([], $translate->lang); $example = ['header' => 'Bonjour', 'content' => ['title' => 'Salut la planète !']]; Translate::addArray($example); $this->assertSame($example, $translate->lang); $this->assertTrue(Translate::exist('header')); $this->assertTrue(Translate::exist('content')); $this->assertTrue(Translate::exist('content.title')); $this->assertFalse(Translate::exist('footer')); $this->assertFalse(Translate::exist('content.description')); $this->assertSame($example['header'], Translate::_('header')); $this->assertSame($example['content'], Translate::_('content')); $this->assertSame($example['content']['title'], Translate::_('content.title')); $this->assertNull(Translate::_('footer')); $this->assertNull(Translate::_('content.description')); }
/** * Test l'unicité de l'objet */ public function testUniqueTranslate() { $translate = TranslateManager::get(); $this->assertSame($translate->getObjectId(), TranslateManager::get()->getObjectId()); }