/** * @test */ public function it_should_hide_attributes_after_to_array() { $country = Country::find(1); $this->assertEquals(true, isset($country->toArray()['name'])); // it is equivalent to set // protected $hidden = ['name']; // in Eloquent $country->setHidden(['name']); $this->assertEquals(false, isset($country->toArray()['name'])); }
/** * @test */ public function it_skips_fallback_if_fallback_is_not_defined() { App::make('config')->set('app.fallback_locale', 'ch'); $country = Country::find(1); $this->assertEquals($country->getTranslation('pl', true)->locale, 'pl'); }
public function test_config_overrides_apps_locale() { $country = Country::find(1); App::make('config')->set('translatable.locale', 'de'); $this->assertSame('Griechenland', $country->name); }
/** * @test */ public function it_fakes_isset_for_translated_attributes() { $country = Country::find(1); $this->assertEquals(true, isset($country->name)); }
public function testRunningMigration() { $country = Country::find(1); $this->assertEquals('gr', $country->code); }
/** * @test */ public function it_has_methods_that_return_always_a_translation() { $country = Country::find(1)->first(); $this->assertSame('abc', $country->translateOrNew('abc')->locale); }