Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

Commit

Permalink
Merge pull request #268 from seregazhuk/develop
Browse files Browse the repository at this point in the history
upd: last error test
  • Loading branch information
seregazhuk authored Apr 18, 2017
2 parents bae2c11 + 26b13e2 commit e8fbb2b
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/Bot/ProvidersContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,37 @@ public function it_delegates_last_error_to_response()
$this->assertEquals($error['message'], $this->container->getLastError());
}

/** @test */
public function it_should_return_last_message_from_response()
{
$error = [
'message' => null,
'code' => 'error_code',
];

$this->response
->shouldReceive('getLastError')
->andReturn($error);

$this->assertEquals($error['code'], $this->container->getLastError());
}

/** @test */
public function it_should_return_last_error_code_from_response()
{
$error = [
'message' => 'error_message',
'code' => 'error_code',
];

$this->response
->shouldReceive('getLastError')
->andReturn($error);

$this->assertEquals($error['message'], $this->container->getLastError());
}


/** @test */
public function it_returns_http_client_instance()
{
Expand Down

0 comments on commit e8fbb2b

Please sign in to comment.