Skip to content

Commit

Permalink
Use FetchMode::COLUMN to avoid DB-platform specific case conversion i…
Browse files Browse the repository at this point in the history
…ssues
  • Loading branch information
mpdude committed Sep 12, 2018
1 parent 7968ecd commit beaaa79
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/Doctrine/Tests/DBAL/Functional/BlobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,23 +136,23 @@ public function testUpdateProcessesStream()

private function assertBlobContains($text)
{
$rows = $this->_conn->query('SELECT * FROM blob_table')->fetchAll(FetchMode::ASSOCIATIVE);
$rows = $this->_conn->query('SELECT blobfield FROM blob_table')->fetchAll(FetchMode::COLUMN);

self::assertCount(1, $rows);

$blobValue = Type::getType('blob')->convertToPHPValue($rows[0]['blobfield'], $this->_conn->getDatabasePlatform());
$blobValue = Type::getType('blob')->convertToPHPValue($rows[0], $this->_conn->getDatabasePlatform());

self::assertInternalType('resource', $blobValue);
self::assertEquals($text, stream_get_contents($blobValue));
}

private function assertClobContains($text)
{
$rows = $this->_conn->query('SELECT * FROM blob_table')->fetchAll(FetchMode::ASSOCIATIVE);
$rows = $this->_conn->query('SELECT clobfield FROM blob_table')->fetchAll(FetchMode::COLUMN);

self::assertCount(1, $rows);

$clobValue = Type::getType('text')->convertToPHPValue($rows[0]['clobfield'], $this->_conn->getDatabasePlatform());
$clobValue = Type::getType('text')->convertToPHPValue($rows[0], $this->_conn->getDatabasePlatform());

self::assertInternalType('string', $clobValue);
self::assertEquals($text, $clobValue);
Expand Down

0 comments on commit beaaa79

Please sign in to comment.