/** * Get stock country * * @return mixed */ public function country() { if ($this->country) { return $this->country; } $this->country = Country::random(); $this->currency = Currency::get($this->country); return $this->country; }
/** * @test */ public function static_method_random_provides_a_random_country_code() { $countryCode = Country::random(); $this->assertEquals(2, strlen($countryCode)); }