merged branch jakzal/dumpfile-tests (PR #7801)
This PR was merged into the master branch.
Discussion
----------
[Filesystem] Added a missing test case for Filesystem::dumpFile()
This PR adds a test case for the ``Filesystem::dumpFile()`` method (introduced in #7753).
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | [![Build Status](https://travis-ci.org/jakzal/symfony.png?branch=dumpfile-tests)](https://travis-ci.org/jakzal/symfony)
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
8fcf4c2
[Filesystem] Added a missing test case for Filesystem::dumpFile().
This commit is contained in:
commit
9f3ce8e3bd
@ -883,6 +883,17 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function testDumpFile()
|
||||
{
|
||||
$filename = $this->workspace.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'baz.txt';
|
||||
|
||||
$this->filesystem->dumpFile($filename, 'bar', 0753);
|
||||
|
||||
$this->assertFileExists($filename);
|
||||
$this->assertSame('bar', file_get_contents($filename));
|
||||
$this->assertEquals(753, $this->getFilePermissions($filename));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns file permissions as three digits (i.e. 755)
|
||||
*
|
||||
|
Reference in New Issue
Block a user