Skip to content

Commit c0f5f62

Browse files
Merge branch '3.4' into 4.1
* 3.4: [travis][appveyor] use symfony/flex to accelerate builds Add missing stderr redirection clean up unused code [Filesystem] Add test to prevent regression when using array|resource with dumpFile [Security] Call AccessListener after LogoutListener
2 parents 2e30335 + 285ce50 commit c0f5f62

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Tests/FilesystemTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,6 +1467,31 @@ public function testDumpFile()
14671467
}
14681468
}
14691469

1470+
public function testDumpFileWithArray()
1471+
{
1472+
$filename = $this->workspace.\DIRECTORY_SEPARATOR.'foo'.\DIRECTORY_SEPARATOR.'baz.txt';
1473+
1474+
$this->filesystem->dumpFile($filename, array('bar'));
1475+
1476+
$this->assertFileExists($filename);
1477+
$this->assertStringEqualsFile($filename, 'bar');
1478+
}
1479+
1480+
public function testDumpFileWithResource()
1481+
{
1482+
$filename = $this->workspace.\DIRECTORY_SEPARATOR.'foo'.\DIRECTORY_SEPARATOR.'baz.txt';
1483+
1484+
$resource = fopen('php://memory', 'rw');
1485+
fwrite($resource, 'bar');
1486+
fseek($resource, 0);
1487+
1488+
$this->filesystem->dumpFile($filename, $resource);
1489+
1490+
fclose($resource);
1491+
$this->assertFileExists($filename);
1492+
$this->assertStringEqualsFile($filename, 'bar');
1493+
}
1494+
14701495
public function testDumpFileOverwritesAnExistingFile()
14711496
{
14721497
$filename = $this->workspace.\DIRECTORY_SEPARATOR.'foo.txt';

0 commit comments

Comments
 (0)