/** @test */ public function it_stores_country() { $dbCountryRepository = new DbCountryRepository(); $countryModel = new Country(); $countryFillableKeys = $countryModel->getFillable(); $expectedCountryData = array_only(factory(Country::class, 'relationless')->make()->toArray(), $countryFillableKeys); $this->dontSeeInDatabase('countries', $expectedCountryData); $country = $dbCountryRepository->store($expectedCountryData); $this->assertNotFalse($country); $this->seeInDatabase('countries', $expectedCountryData); }
/** * Run the database seeds. * * @return void */ public function run() { $dbCountryRepository = new DbCountryRepository(); $dbCountryRepository->store(['name' => 'Greece']); $dbCountryRepository->store(['name' => 'Germany']); }