Skip to content

Commit

Permalink
Tests: revert - add some logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
dasgarner committed Aug 1, 2023
1 parent 2f1f84a commit 49d81d9
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions tests/XmdsTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@

use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Exception\ServerException;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Psr\Container\ContainerInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use Xibo\Support\Exception\GeneralException;

class xmdsTestCase extends TestCase
{
Expand Down Expand Up @@ -74,18 +72,11 @@ protected function sendRequest(
array $headers = ['HTTP_ACCEPT'=>'text/xml']
): ResponseInterface {
// Create a request for tests
try {
return $this->client->request($method, $path . $version, [
'headers' => $headers,
'body' => $body,
'http_errors' => $httpErrors
]);
} catch (ServerException $exception) {
if ($exception->hasResponse()) {
throw new GeneralException($exception->getResponse()->getBody()->getContents());
}
throw new GeneralException('No response');
}
return $this->client->request($method, $path . $version, [
'headers' => $headers,
'body' => $body,
'http_errors' => $httpErrors
]);
}

protected function getFile(
Expand Down

0 comments on commit 49d81d9

Please sign in to comment.