| Total Complexity | 4 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class ApiTest extends ApiTestCase |
||
| 9 | { |
||
| 10 | |||
| 11 | private $candidate; |
||
| 12 | |||
| 13 | public function setup() |
||
| 14 | { |
||
| 15 | parent::setUp(); |
||
| 16 | $this->candidate = $this->getClient()->candidate([ |
||
| 17 | 'first_name' => 'John', |
||
| 18 | 'middle_name' => 'James', |
||
| 19 | 'last_name' => 'Allen', |
||
| 20 | 'ssn' => '111-11-2002', |
||
| 21 | 'dob' => '1980-01-01', |
||
| 22 | 'zipcode' => '90210', |
||
| 23 | 'email' => '[email protected]'])->create(); |
||
| 24 | } |
||
| 25 | |||
| 26 | public function testBadRequest() |
||
| 27 | { |
||
| 28 | $this->expectException(BadRequest::class); |
||
| 29 | $this->candidate->invitation()->create(); |
||
| 30 | } |
||
| 31 | |||
| 32 | public function testFlow() |
||
| 33 | { |
||
| 34 | $invitation = $this->candidate->invitation(['package' => 'tasker_pro'])->create(); |
||
| 35 | $this->assertTrue(isset($invitation->id)); |
||
| 36 | $deleted = $invitation->delete(); |
||
| 37 | $this->assertInstanceOf(get_class($this->getClient()), $deleted); |
||
| 38 | $report = $this->candidate->report(['package' => 'tasker_pro'])->create(); |
||
| 39 | $report = $report->embed('candidate,ssn_trace,county_criminal_searches ')->load(); |
||
| 40 | $this->assertEquals('John', $report->candidate->first_name); |
||
| 41 | } |
||
| 42 | |||
| 43 | public function testListAllCandidates() |
||
| 44 | { |
||
| 45 | $candidates = $this->getClient()->candidate()->all(); |
||
| 46 | $this->assertInstanceOf(Candidate::class, $candidates->first()); |
||
| 47 | } |
||
| 49 | } |