Skip to content

Commit

Permalink
Fixing failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfzdotnet committed Feb 28, 2014
1 parent 290550e commit 3f42dc7
Showing 1 changed file with 34 additions and 8 deletions.
42 changes: 34 additions & 8 deletions test/Tmdb/Tests/HttpClient/HttpClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*/
namespace Tmdb\Tests\HttpClient;

use \Exception;
use Tmdb\Api\AbstractApi;
use Tmdb\ApiToken;
use Tmdb\Client;
Expand Down Expand Up @@ -95,6 +94,22 @@ public function shouldCallPost()
$this->testApi->post('/', array('name' => 'Henk'));
}

/**
* @test
*/
public function shouldCallPostJson()
{
$this->setUp();

$this->guzzleMock
->expects($this->once())
->method('postJson')
->will($this->returnValue($this->getMock('Guzzle\Http\Message\RequestInterface')))
;

$this->testApi->postJson('/', array('name' => 'Henk'));
}

/**
* @test
*/
Expand Down Expand Up @@ -131,7 +146,7 @@ public function shouldCallDelete()
/**
* @test
*/
public function put()
public function shouldCallPut()
{
$this->setUp();

Expand Down Expand Up @@ -184,27 +199,38 @@ public function __construct($client)
$this->client = $client;
}

public function get() {
public function get($path, array $parameters = array(), $headers = array())
{
$this->client->getHttpClient()->get('/');
}

public function head() {
public function head($path, array $parameters = array(), $headers = array())
{
$this->client->getHttpClient()->head('/');
}

public function post() {
public function post($path, $postBody = null, array $parameters = array(), $headers = array())
{
$this->client->getHttpClient()->post('/', array('id' => 1));
}

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

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

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

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

Expand Down

0 comments on commit 3f42dc7

Please sign in to comment.