Skip to content

Commit 9089cd9

Browse files
committed
Replace large GridFS fixture with generated temp file
1 parent 5f6c1fb commit 9089cd9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

tests/GridFS/BigInsertTest.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/GridFS/BucketFunctionalTest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,13 @@ public function testGridInNonIntChunksize()
234234
}
235235
public function testBigInsert()
236236
{
237-
$testPath= __DIR__."/BigInsertTest.txt";
238-
$testStream = fopen($testPath, "r");
239-
$id = $this->bucket->uploadFromStream("BigInsertTest", $testStream);
237+
for ($tmpStream = tmpfile(), $i = 0; $i < 20; $i++) {
238+
fwrite($tmpStream, str_repeat('a', 1048576));
239+
}
240+
241+
fseek($tmpStream, 0);
242+
$this->bucket->uploadFromStream("BigInsertTest", $tmpStream);
243+
fclose($tmpStream);
240244
}
241245
public function testGetIdFromStream()
242246
{

0 commit comments

Comments
 (0)