/** * Execute the command. * * @param CountryRepository $countries * @return Country */ public function handle(CountryRepository $countries) { $country = Country::register($this->iso_code_2, $this->name); $countries->save($country); return $country; }
function it_can_be_registered() { $country = Country::register('NL', 'Netherlands'); \PHPUnit_Framework_Assert::assertEquals('NL', $country->iso_code_2); \PHPUnit_Framework_Assert::assertEquals('Netherlands', $country->name); }