Skip to content
Snippets Groups Projects
Commit 43f99962 authored by Adriano Cori's avatar Adriano Cori
Browse files

Fixed expected result types in test

parent ad1ab19d
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ class HttpClientTest extends UnitTestCase {
*/
public function testGetCommands() {
$commands = $this->client->getCommands();
$this->assertCount(2, $commands);
$this->assertCount(3, $commands);
$this->assertArrayHasKey('FindPosts', $commands);
$this->assertArrayHasKey('FindComments', $commands);
}
......@@ -64,7 +64,7 @@ class HttpClientTest extends UnitTestCase {
public function testGetCommand($commandName) {
$command = $this->client->getCommand($commandName);
$this->assertNotEmpty($command);
$this->assertInstanceOf('Guzzle\Service\Description\Operation', $command);
$this->assertInstanceOf('GuzzleHttp\Command\Guzzle\Operation', $command);
}
/**
......@@ -72,7 +72,7 @@ class HttpClientTest extends UnitTestCase {
*
* @covers ::getCommand
*
* @expectedException \Guzzle\Common\Exception\InvalidArgumentException
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Command was not found matching Missing
*/
public function testGetCommandWhichDoesNotExists() {
......@@ -88,12 +88,13 @@ class HttpClientTest extends UnitTestCase {
public function testCall() {
$result = $this->client->call('FindPosts');
$this->assertNotEmpty($result);
$this->assertInternalType('array', $result);
$this->assertGreaterThan(1, count($result));
$this->assertInstanceOf('GuzzleHttp\Command\Result', $result);
$this->assertGreaterThan(1, $result->count());
$result = $this->client->call('FindPosts', ['postId' => 1]);
$this->assertNotEmpty($result);
$this->assertInternalType('array', $result);
$this->assertInstanceOf('GuzzleHttp\Command\Result', $result);
$result = $result->toArray();
$this->assertArrayHasKey('id', $result);
$this->assertEquals(1, $result['id']);
$this->assertCount(4, $result);
......@@ -111,7 +112,7 @@ class HttpClientTest extends UnitTestCase {
*
* @covers ::call
*
* @expectedException \Guzzle\Common\Exception\InvalidArgumentException
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Command was not found matching Missing
*/
public function testCallWithWrongCommandName() {
......@@ -149,7 +150,7 @@ class HttpClientTest extends UnitTestCase {
*
* @covers ::__call
*
* @expectedException \Guzzle\Common\Exception\InvalidArgumentException
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Command was not found matching missing
*/
public function testMagicMethodCallWithWrongCommandName() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment