Check integration tests under tests/Integration
for library use cases.
use GuzzleHttp\Middleware;
use GuzzleHttp\MessageFormatter;
use Monolog\Logger;
$log = Middleware::log(new Logger('requests'), new MessageFormatter(MessageFormatter::DEBUG));
$client = Dokobit\Client::create([
'apiKey' => 'xxxxxx',
'sandbox' => true,
], $log);
Read more:
http://www.php-fig.org/psr/psr-3/
https://github.com/Seldaek/monolog
To dig more into occured error use following methods. A
echo (string) $exception->getMessage()
echo (string) $exception->getPrevious()->getResponse()
var_dump( $exception->getResponseData() )
Available on all exception classes except UnexpectedError
and QueryValidator
.
Whole testsuite including integrational tests
phpunit
Don't forget to define SANDBOX_API_KEY
in your phpunit.xml.
Running unit tests only:
phpunit --testsuite=Unit
Running integrational tests only:
phpunit --testsuite=Integration
Running single testcase:
phpunit tests/Integration/MobileSignTest.php