Skip to content

Commit a17abb1

Browse files
committed
Test file put contents
1 parent 452182e commit a17abb1

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/Adapters/FileTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,4 +233,16 @@ public function testRename(LoopInterface $loop, FilesystemInterface $filesystem)
233233
$this->assertFileExists($tempFileTo);
234234
$this->assertSame($filenameFrom, file_get_contents($tempFileTo));
235235
}
236+
/**
237+
* @dataProvider filesystemProvider
238+
*/
239+
public function testPutContents(LoopInterface $loop, FilesystemInterface $filesystem)
240+
{
241+
$contents = str_repeat('abc', 1024 * 1024 * 5);
242+
$filename = uniqid('', true);
243+
$tempFile = $this->tmpDir . $filename;
244+
$this->await($filesystem->file($tempFile)->putContents($contents), $loop);
245+
$this->assertFileExists($tempFile);
246+
$this->assertSame($contents, file_get_contents($tempFile));
247+
}
236248
}

0 commit comments

Comments
 (0)