public function test_through_two() { $city = Stub_Test_Model_City::where('id', 1)->first(); $this->assertNotNull($city->country); $this->assertEquals(1, $city->country->id); }
public function test_custom_foreign_key_through_two() { $city = Stub_Test_Model_City::where('id', 1)->first(); $this->assertNotNull($city->offshoreCountry); $this->assertEquals(1, $city->offshoreCountry->id); }