baartosz d7202a7c76 [php] 2.3 - fix form params json encoding (#5701)
* fixed tests expectations not compatible with phpunit 4

* added test and endpoint definition, updated template

* regenerated sample

* regenerated security sample
2017-06-05 00:36:40 +08:00

42 lines
973 B
PHP

<?php
namespace Swagger\Client;
use GuzzleHttp\Client;
class ExceptionTest extends \PHPUnit_Framework_TestCase
{
/**
* @expectedException \Swagger\Client\ApiException
* @expectedExceptionCode 404
* @expectedExceptionMessage http://petstore.swagger.io/INVALID_URL/store/inventory
*/
public function testNotFound()
{
$config = new Configuration();
$config->setHost('http://petstore.swagger.io/INVALID_URL');
$api = new Api\StoreApi(
new Client(),
$config
);
$api->getInventory();
}
/**
* @expectedException \Swagger\Client\ApiException
* @expectedExceptionMessage Could not resolve host
*/
public function testWrongHost()
{
$config = new Configuration();
$config->setHost('http://wrong_host.zxc');
$api = new Api\StoreApi(
new Client(),
$config
);
$api->getInventory();
}
}