where('account', 1)->execute())->id === 0) { $profile = new Profile(); $profile->account = AccountMapper::get()->where('id', 1)->execute(); $profile->birthday = ($date = new \DateTime('now')); $id = ProfileMapper::create()->execute($profile); } $employee = new Employee($profile); $id = EmployeeMapper::create()->execute($employee); self::assertGreaterThan(0, $employee->id); self::assertEquals($id, $employee->id); $employeeR = EmployeeMapper::get()->where('id', $employee->id)->execute(); self::assertEquals($employee->profile->id, $employeeR->profile->id); self::assertGreaterThan(0, EmployeeMapper::get()->with('profile')->where('profile/account', 1)->limit(1)->execute()->id); } }