Skip to content

Commit

Permalink
Finlizing things for zr tests and provider
Browse files Browse the repository at this point in the history
  • Loading branch information
karllhughes committed Aug 7, 2015
1 parent 0edfa54 commit 0393023
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# ZipRecruiter Jobs Client

**NOTE: Still working on this provider**

[![Latest Version](https://img.shields.io/github/release/JobBrander/jobs-ziprecruiter.svg?style=flat-square)](https://github.com/JobBrander/jobs-ziprecruiter/releases)
[![Software License](https://img.shields.io/badge/license-APACHE%202.0-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Build Status](https://img.shields.io/travis/JobBrander/jobs-ziprecruiter/master.svg?style=flat-square&1)](https://travis-ci.org/JobBrander/jobs-ziprecruiter)
Expand Down
3 changes: 2 additions & 1 deletion src/Ziprecruiter.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ public function createJobObject($payload)
'location' => $payload['location'],
]);

$job->setCompany($payload['hiring_company'])
$job->setCompany($payload['hiring_company']['name'])
->setCompanyUrl($payload['hiring_company']['url'])
->setDatePostedAsString($payload['posted_time'])
->setCity($payload['city'])
->setState($payload['state']);
Expand Down
11 changes: 6 additions & 5 deletions tests/src/ZiprecruiterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,18 @@ public function testItCanCreateJobFromPayload()

$this->assertEquals($payload['name'], $results->title);
$this->assertEquals($payload['snippet'], $results->description);
$this->assertEquals($payload['hiring_company'], $results->company);
$this->assertEquals($payload['hiring_company']['name'], $results->company);
$this->assertEquals($payload['url'], $results->url);
$this->assertEquals($payload['id'], $results->sourceId);
$this->assertEquals($payload['location'], $results->location);
}

/*
public function testItCanConnect()
{
$provider = $this->getProviderAttributes();

for ($i = 0; $i < $provider['jobs_count']; $i++) {
$payload['results'][] = $this->createJobArray();
$payload['jobs'][] = $this->createJobArray();
}

$responseBody = json_encode($payload);
Expand All @@ -198,7 +197,6 @@ public function testItCanConnect()
$this->assertInstanceOf($this->collectionClass, $results);
$this->assertCount($provider['jobs_count'], $results);
}
*/

private function createJobArray() {
return [
Expand All @@ -208,7 +206,10 @@ private function createJobArray() {
'location' => uniqid(),
'snippet' => uniqid(),
'category' => uniqid(),
'hiring_company' => uniqid(),
'hiring_company' => [
'url' => uniqid(),
'name' => uniqid(),
],
'posted_time' => '2015-07-'.rand(1,31),
'url' => uniqid(),
];
Expand Down

0 comments on commit 0393023

Please sign in to comment.