public function getDriver() { return $this->embeddedOne(oResident::className(), 'driver'); }
public function testCreateResident() { //simulate form input $post = ['oResident' => ['role' => '2', 'PersonSurname' => 'Ivanov', 'PersonName' => 'Ivan', 'PersonMiddleName' => 'Ivanovich', 'PersonPost' => 'Driver', 'ContactPhone' => '+7878787777', 'sex' => 'male', 'email' => '*****@*****.**']]; $resident = new oResident(); $this->assertTrue($resident->load($post), 'Load resident POST data'); $this->assertTrue($resident->validate(), 'Validate resident'); $this->assertTrue($resident->save(), 'Create resident'); return $resident; }