Skip to content

Commit

Permalink
Tweak tests as suggested on GitHub #3217
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdude committed Sep 11, 2018
1 parent 988cd79 commit 0cd703f
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions tests/Doctrine/Tests/DBAL/Functional/BlobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,38 +58,17 @@ public function testInsert()
}

public function testInsertProcessesStream()
{
$this->_conn->insert('blob_table', [
'id' => 1,
'clobfield' => fopen('data://text/plain,test', 'r'),
'blobfield' => fopen('data://text/plain,test', 'r'),
'binaryfield' => fopen('data://text/plain,test', 'r'),
], [
ParameterType::INTEGER,
ParameterType::LARGE_OBJECT,
ParameterType::LARGE_OBJECT,
ParameterType::LARGE_OBJECT,
]);

$this->assertClobContains('test');
$this->assertBlobContains('test');
$this->assertBinaryContains('test');
}

public function testInsertCanHandleStreamLongerThanChunkSize()
{
$longBlob = str_repeat('x', 40000);

$this->_conn->insert('blob_table', [
'id' => 1,
'clobfield' => fopen('data://text/plain,' . $longBlob, 'r'),
'blobfield' => fopen('data://text/plain,' . $longBlob, 'r'),
'binaryfield' => 'ignored', // field too short
], [
ParameterType::INTEGER,
ParameterType::LARGE_OBJECT,
ParameterType::LARGE_OBJECT,
ParameterType::LARGE_OBJECT,
]);

$this->assertClobContains($longBlob);
Expand Down Expand Up @@ -151,29 +130,24 @@ public function testUpdateProcessesStream()
'id' => 1,
'clobfield' => 'test',
'blobfield' => 'test',
'binaryfield' => 'test',
], [
ParameterType::INTEGER,
ParameterType::LARGE_OBJECT,
ParameterType::LARGE_OBJECT,
ParameterType::LARGE_OBJECT,
]);

$this->_conn->update('blob_table', [
'id' => 1,
'clobfield' => fopen('data://text/plain,test2', 'r'),
'blobfield' => fopen('data://text/plain,test2', 'r'),
'binaryfield' => fopen('data://text/plain,test2', 'r'),
], ['id' => 1], [
ParameterType::INTEGER,
ParameterType::LARGE_OBJECT,
ParameterType::LARGE_OBJECT,
ParameterType::LARGE_OBJECT,
]);

$this->assertClobContains('test2');
$this->assertBlobContains('test2');
$this->assertBinaryContains('test2');
}

private function assertBinaryContains($text)
Expand Down

0 comments on commit 0cd703f

Please sign in to comment.