Skip to content

Commit

Permalink
Fixing jobs collection and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfzdotnet committed Feb 28, 2014
1 parent 3f42dc7 commit 34f31b0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
9 changes: 6 additions & 3 deletions lib/Tmdb/Model/Collection/Jobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ function($key, $value) use ($department) {
);

if ($result && 1 === count($result)) {
return array_shift($result->toArray());
$results = $result->toArray();
return array_shift($results);
}

return $result;
Expand All @@ -56,7 +57,8 @@ function($key, $value) use ($department) {
);

if ($result && 1 === count($result)) {
$data = array_shift($result->toArray());
$results = $result->toArray();
$data = array_shift($results);

return $data->getJobList();
}
Expand All @@ -83,7 +85,8 @@ function($key, $value) use ($filterByJob) {
);

if ($result && 1 === count($result)) {
return array_shift($result->toArray());
$results = $result->toArray();
return array_shift($results);
}

return $result;
Expand Down
4 changes: 2 additions & 2 deletions test/Tmdb/Tests/HttpClient/HttpClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ public function delete($path, $body = null, array $parameters = array(), $header
$this->client->getHttpClient()->delete('http://www.google.com/');
}

public function postJson($path, $postBody = null, array $parameters = array(), $headers = array())
public function postJson($path, $postBody, array $parameters = array(), $headers = array())
{
$this->client->getHttpClient()->postJson('http://www.google.com/');
$this->client->getHttpClient()->postJson('http://www.google.com/', $postBody);
}

public function put($path, $body = null, array $parameters = array(), $headers = array())
Expand Down
3 changes: 2 additions & 1 deletion test/Tmdb/Tests/Model/ImageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public function shouldGetAndSet()
/**
* @var Image $subject
*/
$subject = array_pop($this->collection->toArray());
$results = $this->collection->toArray();
$subject = array_pop($results);

$this->assertEquals('/abc.jpg', $subject->getFilePath());
$this->assertEquals(1000, $subject->getWidth());
Expand Down

0 comments on commit 34f31b0

Please sign in to comment.