function it_throws_if_trying_to_define_province_which_does_not_belong_to_country(CountryInterface $country, ProvinceInterface $province) { $country->hasProvince($province)->willReturn(false); $this->setCountry($country); $country->getName()->willReturn('United States'); $province->getName()->willReturn('Quebec'); $expectedExceptionMessage = 'Cannot set province "Quebec", because it does not belong to country "United States"'; $this->shouldThrow(new \InvalidArgumentException($expectedExceptionMessage))->duringSetProvince($province); }
function it_has_fluent_interface(CountryInterface $country, ProvinceInterface $province) { $this->setFirstName('John')->shouldReturn($this); $this->setLastName('Doe')->shouldReturn($this); $this->setStreet('Foo Street 3-44')->shouldReturn($this); $this->setCity('Nashville')->shouldReturn($this); $this->setPostcode('53562')->shouldReturn($this); $country->hasProvince($province)->willReturn(true); $this->setCountry($country)->shouldReturn($this); $this->setProvince($province)->shouldReturn($this); }