public function testCreate() { \Onfido\Config::init()->set_token('test_NY2rpxJR3C0YwS9WWDzSMoFJ5s95-7aV'); $random = time() . rand(0, 999); $applicant = new \Onfido\Applicant(); $applicant->first_name = 'John' . $random; $applicant->last_name = 'Smith'; $applicant->email = 'email' . $random . '@server.com'; $address1 = new \Onfido\Address(); $address1->postcode = 'abc'; $address1->town = 'London'; $address1->country = 'GBR'; $applicant->addresses = array($address1); $response = $applicant->create(); $this->assertInstanceOf('stdClass', $response); $this->assertObjectHasAttribute('first_name', $response); $this->assertEquals($response->first_name, 'John' . $random); $check = new \Onfido\Check(); $check->type = 'standard'; $report1 = new \Onfido\CheckReport(); $report1->name = 'identity'; $check->reports = array($report1); $response = $check->create_for($response->id); $this->assertInstanceOf('stdClass', $response); }
public function testCreate() { \Onfido\Config::init()->set_token('test_NY2rpxJR3C0YwS9WWDzSMoFJ5s95-7aV'); $random = time() . rand(0, 999); $applicant = new \Onfido\Applicant(); $applicant->first_name = 'John' . $random; $applicant->last_name = 'Smith'; $applicant->email = 'email' . $random . '@server.com'; $address1 = new \Onfido\Address(); $address1->postcode = 'abc'; $address1->town = 'London'; $address1->country = 'GBR'; $applicant->addresses = [$address1]; $response = $applicant->create(); // var_dump($response); $this->assertInstanceOf('stdClass', $response); $this->assertObjectHasAttribute('first_name', $response); $this->assertEquals($response->first_name, 'John' . $random); }