Inital commit for unit test configuration

This commit is contained in:
Manish Verma
2018-09-05 12:36:46 +05:30
committed by Manish Verma
parent 2f0796e954
commit e0436b7757
252 changed files with 3219 additions and 1631 deletions

View File

@@ -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';