Inital commit for unit test configuration
This commit is contained in:

committed by
Manish Verma

parent
2f0796e954
commit
e0436b7757
@@ -1467,6 +1467,31 @@ class FilesystemTest extends FilesystemTestCase
|
||||
}
|
||||
}
|
||||
|
||||
public function testDumpFileWithArray()
|
||||
{
|
||||
$filename = $this->workspace.\DIRECTORY_SEPARATOR.'foo'.\DIRECTORY_SEPARATOR.'baz.txt';
|
||||
|
||||
$this->filesystem->dumpFile($filename, array('bar'));
|
||||
|
||||
$this->assertFileExists($filename);
|
||||
$this->assertStringEqualsFile($filename, 'bar');
|
||||
}
|
||||
|
||||
public function testDumpFileWithResource()
|
||||
{
|
||||
$filename = $this->workspace.\DIRECTORY_SEPARATOR.'foo'.\DIRECTORY_SEPARATOR.'baz.txt';
|
||||
|
||||
$resource = fopen('php://memory', 'rw');
|
||||
fwrite($resource, 'bar');
|
||||
fseek($resource, 0);
|
||||
|
||||
$this->filesystem->dumpFile($filename, $resource);
|
||||
|
||||
fclose($resource);
|
||||
$this->assertFileExists($filename);
|
||||
$this->assertStringEqualsFile($filename, 'bar');
|
||||
}
|
||||
|
||||
public function testDumpFileOverwritesAnExistingFile()
|
||||
{
|
||||
$filename = $this->workspace.\DIRECTORY_SEPARATOR.'foo.txt';
|
||||
|
Reference in New Issue
Block a user