Skip to content

Commit

Permalink
JsonTest. Deal with json returned as a stream not string.
Browse files Browse the repository at this point in the history
It seems Oracle 11 returns json as a stream so convert streams to
strings.
  • Loading branch information
cgknx committed Feb 15, 2023
1 parent e50aae6 commit 246bf28
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/Functional/Types/JsonTest.php
Expand Up @@ -9,7 +9,9 @@
use Doctrine\DBAL\Tests\FunctionalTestCase;
use Doctrine\DBAL\Types\Type;

use function is_resource;
use function json_decode;
use function stream_get_contents;

class JsonTest extends FunctionalTestCase
{
Expand Down Expand Up @@ -69,6 +71,10 @@ private function select(int $id): array
[ParameterType::INTEGER],
);

if (is_resource($value)) {
$value = stream_get_contents($value);
}

self::assertIsString($value);

$value = json_decode($value, true);
Expand Down

0 comments on commit 246bf28

Please sign in to comment.