mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-05-10 15:54:18 +00:00
[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
This commit is contained in:
@@ -6,12 +6,13 @@ 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()
|
||||
{
|
||||
$this->expectException(ApiException::class);
|
||||
$this->expectExceptionCode(404);
|
||||
$this->expectExceptionMessage('http://petstore.swagger.io/INVALID_URL/store/inventory');
|
||||
|
||||
$config = new Configuration();
|
||||
$config->setHost('http://petstore.swagger.io/INVALID_URL');
|
||||
|
||||
@@ -22,11 +23,12 @@ class ExceptionTest extends \PHPUnit_Framework_TestCase
|
||||
$api->getInventory();
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Swagger\Client\ApiException
|
||||
* @expectedExceptionMessage Could not resolve host
|
||||
*/
|
||||
public function testWrongHost()
|
||||
{
|
||||
$this->expectException(ApiException::class);
|
||||
$this->expectExceptionMessage('Could not resolve host');
|
||||
|
||||
$config = new Configuration();
|
||||
$config->setHost('http://wrong_host.zxc');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user