示例#1
0
 public function test_scope_withTranslation_with_fallback()
 {
     App::make('config')->set('translatable.fallback_locale', 'de');
     App::make('config')->set('translatable.use_fallback', true);
     $result = Country::withTranslation()->first();
     $loadedTranslations = $result->toArray()['translations'];
     $this->assertCount(2, $loadedTranslations);
     $this->assertSame('Greece', $loadedTranslations[0]['name']);
     $this->assertSame('Griechenland', $loadedTranslations[1]['name']);
 }