forked from loafle/openapi-generator-original
* Add testcase which reproduces issue #6770 * Pass debug option if needed * Update samples * bin/php-petstore.sh * bin/security/php-petstore.sh * Api throws exception when failed to open debug file * Pass debug option if needed (Async) * Extract instance method * Update samples * bin/php-petstore.sh * bin/security/php-petstore.sh
27 lines
669 B
PHP
27 lines
669 B
PHP
<?php
|
|
namespace Swagger\Client;
|
|
|
|
class DebugTest extends \PHPUnit_Framework_TestCase
|
|
{
|
|
public function testEnableDebugOutput()
|
|
{
|
|
$this->expectOutputRegex('#GET /v2/pet/1 HTTP/1.1#');
|
|
|
|
$config = new Configuration();
|
|
$config->setDebug(true);
|
|
$api = new Api\PetApi(null, $config);
|
|
$api->getPetById(1);
|
|
}
|
|
|
|
public function testEnableDebugOutputAsync()
|
|
{
|
|
$this->expectOutputRegex('#GET /v2/pet/1 HTTP/1.1#');
|
|
|
|
$config = new Configuration();
|
|
$config->setDebug(true);
|
|
$api = new Api\PetApi(null, $config);
|
|
$promise = $api->getPetByIdAsync(1);
|
|
$promise->wait();
|
|
}
|
|
}
|