-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
attribute to deny translating api errors to exceptions
- Loading branch information
1 parent
44f8153
commit cd9f261
Showing
2 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/** | ||
* | ||
* Test if an error message from API raises a ClientException | ||
* | ||
* User: Ondrej Hlavacek | ||
* Date: 11.12.12 | ||
* Time: 17:22 PST | ||
* | ||
*/ | ||
|
||
class Keboola_StorageApi_ExceptionsTest extends StorageApiTestCase | ||
{ | ||
/** | ||
* @expectedException Keboola\StorageApi\ClientException | ||
*/ | ||
public function testException() | ||
{ | ||
$this->_client->getTable("nonexistingtable"); | ||
} | ||
|
||
public function testErrorMessage() | ||
{ | ||
$this->_client->translateApiErrors = false; | ||
$response = $this->_client->getTable("nonexistingtable"); | ||
$this->assertEquals("accessDenied", $response["code"]); | ||
$this->_client->translateApiErrors = true; | ||
} | ||
} |