Skip to content

Commit

Permalink
[BRA-1811] Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leightonthomas committed Nov 16, 2018
1 parent 7681a47 commit 99abb8b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/Vivait/DocBuild/DocBuildTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Vivait\DocBuild\Exception\UnauthorizedException;
use Vivait\DocBuild\Http\Adapter;
use Vivait\DocBuild\Http\Response;
use Vivait\DocBuild\Model\HttpException;
use Vivait\DocBuild\Exception\HttpException;

class DocBuildTest extends TestCase
{
Expand Down Expand Up @@ -133,7 +133,9 @@ public function itWillCorrectlyDownloadADocument(): void

self::assertSame($fakeExternalFile->getContent(), $actualFile->getContent());

\fclose($fakeExternalStream);
if (\is_resource($fakeExternalStream)) {
\fclose($fakeExternalStream);
}
}

/**
Expand Down Expand Up @@ -166,6 +168,7 @@ public function itErrorsWithInvalidCredentials(int $status): void

$exception = new HttpException(
$status,
"Test",
$req1 = new Response(
200,
$this->asStream(\json_encode(['error_description' => 'unrecognised error']))
Expand Down Expand Up @@ -210,6 +213,7 @@ public function itWillThrowAnExceptionIfTheCacheKeyCannotBeDeleted(int $status):

$exception = new HttpException(
$status,
"Test",
$req1 = new Response(
200,
$this->asStream(\json_encode(['error_description' => 'unrecognised error']))
Expand Down Expand Up @@ -248,6 +252,7 @@ public function itWillThrowAnExceptionIfTheTokenIsExpired(int $status): void

$exception = new HttpException(
$status,
"Test",
$req1 = new Response(
200,
$this->asStream(\json_encode(['error_description' => DocBuild::TOKEN_EXPIRED]))
Expand Down Expand Up @@ -286,6 +291,7 @@ public function itWillThrowAnExceptionIfTheTokenIsInvalid(int $status): void

$exception = new HttpException(
$status,
"Test",
$req1 = new Response(
200,
$this->asStream(\json_encode(['error_description' => DocBuild::TOKEN_INVALID]))
Expand Down

0 comments on commit 99abb8b

Please sign in to comment.