@@ 701-710 (lines=10) @@ | ||
698 | $this->assertSame(null, $country->name); |
|
699 | } |
|
700 | ||
701 | public function test_translation_relation() |
|
702 | { |
|
703 | $this->app->make('config')->set('translatable.fallback_locale', 'fr'); |
|
704 | $this->app->make('config')->set('translatable.use_fallback', true); |
|
705 | $this->app->setLocale('en'); |
|
706 | ||
707 | $translation = Country::find(1)->translation; |
|
708 | $this->assertInstanceOf(CountryTranslation::class, $translation); |
|
709 | $this->assertEquals('en', $translation->locale); |
|
710 | } |
|
711 | ||
712 | public function test_translation_relation_fallback() |
|
713 | { |
|
@@ 712-721 (lines=10) @@ | ||
709 | $this->assertEquals('en', $translation->locale); |
|
710 | } |
|
711 | ||
712 | public function test_translation_relation_fallback() |
|
713 | { |
|
714 | $this->app->make('config')->set('translatable.fallback_locale', 'fr'); |
|
715 | $this->app->make('config')->set('translatable.use_fallback', true); |
|
716 | $this->app->setLocale('xyz'); |
|
717 | ||
718 | $translation = Country::find(1)->translation; |
|
719 | $this->assertInstanceOf(CountryTranslation::class, $translation); |
|
720 | $this->assertEquals('fr', $translation->locale); |
|
721 | } |
|
722 | ||
723 | public function test_translation_relation_not_found() |
|
724 | { |