public function test_through_one() { $district = Stub_Test_Model_District::where('id', 1)->first(); $this->assertNotNull($district->country); $this->assertEquals(1, $district->country->id); }
public function test_custom_foreign_key() { $district = Stub_Test_Model_District::where('id', 1)->first(); $this->assertNotNull($district->countryOffshore); $this->assertEquals(1, $district->countryOffshore->id); }