| @@ 7-83 (lines=77) @@ | ||
| 4 | use Lyal\Checkr\Entities\Screenings\CountyCriminalSearch; |
|
| 5 | use Tests\UnitTestCase; |
|
| 6 | ||
| 7 | class CountyCriminalSearchTest extends UnitTestCase |
|
| 8 | { |
|
| 9 | public function testInstantiation() |
|
| 10 | { |
|
| 11 | $this->assertInstanceOf('Lyal\Checkr\Entities\Screenings\CountyCriminalSearch', $this->getCountyCriminalSearch()); |
|
| 12 | } |
|
| 13 | ||
| 14 | public function testSetId() |
|
| 15 | { |
|
| 16 | $countyCriminalSearch = $this->getCountyCriminalSearch(); |
|
| 17 | $countyCriminalSearch->id = 'e44aa283528e6fde7d542194'; |
|
| 18 | $this->assertSame('e44aa283528e6fde7d542194', $countyCriminalSearch->id); |
|
| 19 | } |
|
| 20 | ||
| 21 | public function testFields() |
|
| 22 | { |
|
| 23 | $values = [ |
|
| 24 | 'id' => '539fdcf335644a0ef4000001', |
|
| 25 | 'object' => 'county_criminal_search', |
|
| 26 | 'uri' => '/v1/county_criminal_searches/539fdcf335644a0ef4000001', |
|
| 27 | 'status' => 'consider', |
|
| 28 | 'created_at' => '2014-01-18T12:34:00Z', |
|
| 29 | 'completed_at' => '2014-01-18T12:35:30Z', |
|
| 30 | 'turnaround_time' => 100800, |
|
| 31 | 'county' => 'SAN FRANCISCO', |
|
| 32 | 'state' => 'CA', |
|
| 33 | 'records' => [ |
|
| 34 | 'case_number' => '24323-DA', |
|
| 35 | 'file_date' => '2010-02-18', |
|
| 36 | 'arresting_agency' => 'San Francisco Police Department', |
|
| 37 | 'court_jurisdiction' => 'San Francisco', |
|
| 38 | 'court_of_record' => NULL, |
|
| 39 | 'dob' => '1970-01-22', |
|
| 40 | 'full_name' => 'John Alfred Smith', |
|
| 41 | 'charges' => |
|
| 42 | [ |
|
| 43 | 'charge' => 'Sell Cocaine', |
|
| 44 | 'charge_type' => NULL, |
|
| 45 | 'charge_id' => NULL, |
|
| 46 | 'classification' => 'Felony', |
|
| 47 | 'deposition' => NULL, |
|
| 48 | 'defendant' => 'John Alfred Smith', |
|
| 49 | 'plaintiff' => NULL, |
|
| 50 | 'sentence' => 'Active Punishment Minimum: 10M', |
|
| 51 | 'disposition' => 'Guilty', |
|
| 52 | 'probation_status' => NULL, |
|
| 53 | 'offense_date' => '2011-04-22', |
|
| 54 | 'deposition_date' => '2014-05-27', |
|
| 55 | 'arrest_date' => '2011-04-22', |
|
| 56 | 'charge_date' => NULL, |
|
| 57 | 'sentence_date' => '2011-06-02', |
|
| 58 | 'disposition_date' => '2011-06-02', |
|
| 59 | ] |
|
| 60 | ] |
|
| 61 | ]; |
|
| 62 | ||
| 63 | $countyCriminalSearch = $this->getCountyCriminalSearch($values); |
|
| 64 | ||
| 65 | foreach ($values as $key => $value) { |
|
| 66 | if (is_array($value)) { |
|
| 67 | $value = collect($value); |
|
| 68 | } |
|
| 69 | ||
| 70 | $this->assertEquals($value, $countyCriminalSearch->{$key}); |
|
| 71 | } |
|
| 72 | ||
| 73 | } |
|
| 74 | ||
| 75 | /** |
|
| 76 | * @param null $values |
|
| 77 | * @return CountyCriminalSearch |
|
| 78 | */ |
|
| 79 | protected function getCountyCriminalSearch($values = NULL) |
|
| 80 | { |
|
| 81 | return new CountyCriminalSearch($values,$this->getClient()); |
|
| 82 | } |
|
| 83 | } |
|
| @@ 7-81 (lines=75) @@ | ||
| 4 | use Lyal\Checkr\Entities\Screenings\StateCriminalSearch; |
|
| 5 | use Tests\UnitTestCase; |
|
| 6 | ||
| 7 | class StateCriminalSearchTest extends UnitTestCase |
|
| 8 | { |
|
| 9 | public function testInstantiation() |
|
| 10 | { |
|
| 11 | $this->assertInstanceOf('Lyal\Checkr\Entities\Screenings\StateCriminalSearch', $this->getStateCriminalSearch()); |
|
| 12 | } |
|
| 13 | ||
| 14 | public function testSetId() |
|
| 15 | { |
|
| 16 | $stateCriminalSearch = $this->getStateCriminalSearch(); |
|
| 17 | $stateCriminalSearch->id = 'e44aa283528e6fde7d542194'; |
|
| 18 | $this->assertSame('e44aa283528e6fde7d542194', $stateCriminalSearch->id); |
|
| 19 | } |
|
| 20 | ||
| 21 | public function testFields() |
|
| 22 | { |
|
| 23 | $values = [ |
|
| 24 | 'id' => '539fdcf335644a0ef4000001', |
|
| 25 | 'object' => 'state_criminal_search', |
|
| 26 | 'uri' => '/v1/state_criminal_searches/539fdcf335644a0ef4000001', |
|
| 27 | 'status' => 'consider', |
|
| 28 | 'created_at' => '2014-01-18T12:34:00Z', |
|
| 29 | 'completed_at' => '2014-01-18T12:35:30Z', |
|
| 30 | 'turnaround_time' => 100800, |
|
| 31 | 'state' => 'CA', |
|
| 32 | 'records' => [ |
|
| 33 | [ |
|
| 34 | 'case_number' => '24323-DA', |
|
| 35 | 'file_date' => '2010-02-18', |
|
| 36 | 'arresting_agency' => 'San Francisco Police Department', |
|
| 37 | 'court_jurisdiction' => 'San Francisco', |
|
| 38 | 'court_of_record' => NULL, |
|
| 39 | 'dob' => '1970-01-22', |
|
| 40 | 'full_name' => 'John Alfred Smith', |
|
| 41 | 'charges' => [ |
|
| 42 | ['charge' => 'Sell Cocaine', |
|
| 43 | 'charge_type' => NULL, |
|
| 44 | 'charge_id' => NULL, |
|
| 45 | 'classification' => 'Felony', |
|
| 46 | 'deposition' => NULL, |
|
| 47 | 'defendant' => 'John Alfred Smith', |
|
| 48 | 'plaintiff' => NULL, |
|
| 49 | 'sentence' => 'Active Punishment Minimum: 10M', |
|
| 50 | 'disposition' => 'Guilty', |
|
| 51 | 'probation_status' => NULL, |
|
| 52 | 'offense_date' => '2011-04-22', |
|
| 53 | 'deposition_date' => '2014-05-27', |
|
| 54 | 'arrest_date' => '2011-04-22', |
|
| 55 | 'charge_date' => NULL, |
|
| 56 | 'sentence_date' => '2011-06-02', |
|
| 57 | 'disposition_date' => '2011-06-02', |
|
| 58 | ] |
|
| 59 | ||
| 60 | ] |
|
| 61 | ] |
|
| 62 | ] |
|
| 63 | ]; |
|
| 64 | ||
| 65 | $stateCriminalSearch = $this->getStateCriminalSearch($values); |
|
| 66 | ||
| 67 | foreach ($values as $key => $value) { |
|
| 68 | if (is_array($value)) { |
|
| 69 | $value = collect($value); |
|
| 70 | } |
|
| 71 | ||
| 72 | $this->assertEquals($value, $stateCriminalSearch->{$key}); |
|
| 73 | } |
|
| 74 | ||
| 75 | } |
|
| 76 | ||
| 77 | protected function getStateCriminalSearch($values = NULL) |
|
| 78 | { |
|
| 79 | return new StateCriminalSearch($values,$this->getClient()); |
|
| 80 | } |
|
| 81 | } |
|