Skip to content

Commit

Permalink
Merge pull request #6 from jobapis/adding-fields
Browse files Browse the repository at this point in the history
Adding ziprecruiter specific fields to job
  • Loading branch information
karllhughes authored Oct 4, 2017
2 parents 7aae983 + 6d186f3 commit f100d99
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Providers/ZiprecruiterProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ public function createJobObject($payload)
->setCity($payload['city'])
->setState($payload['state']);

$job->job_age = $payload['job_age'];
$job->posted_time_friendly = $payload['posted_time_friendly'];
$job->has_non_zr_url = $payload['has_non_zr_url'];

return $job;
}

Expand Down
6 changes: 6 additions & 0 deletions tests/src/ZiprecruiterProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public function testItCanCreateJobObjectFromPayload()
$this->assertEquals($payload['snippet'], $results->getDescription());
$this->assertEquals($payload['hiring_company']['name'], $results->getCompanyName());
$this->assertEquals($payload['url'], $results->getUrl());
$this->assertEquals($payload['job_age'], $results->job_age);
$this->assertEquals($payload['posted_time_friendly'], $results->posted_time_friendly);
$this->assertEquals($payload['has_non_zr_url'], $results->has_non_zr_url);
}

/**
Expand Down Expand Up @@ -138,6 +141,9 @@ private function createJobArray() {
'url' => uniqid(),
'city' => null,
'state' => null,
'job_age' => rand(1, 100),
'posted_time_friendly' => uniqid(),
'has_non_zr_url' => rand(0, 1),
];
}
}

0 comments on commit f100d99

Please sign in to comment.