composer update

This commit is contained in:
Manish Verma
2018-12-05 10:50:52 +05:30
parent 9eabcacfa7
commit 4addd1e9c6
3328 changed files with 156676 additions and 138988 deletions

View File

@@ -50,6 +50,10 @@ class FilesystemTest extends FilesystemTestCase
$this->markTestSkipped('This test cannot run on Windows.');
}
if (!getenv('USER') || 'root' === getenv('USER')) {
$this->markTestSkipped('This test will fail if run under superuser');
}
$sourceFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_source_file';
$targetFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_target_file';
@@ -124,6 +128,10 @@ class FilesystemTest extends FilesystemTestCase
$this->markTestSkipped('This test cannot run on Windows.');
}
if (!getenv('USER') || 'root' === getenv('USER')) {
$this->markTestSkipped('This test will fail if run under superuser');
}
$sourceFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_source_file';
$targetFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_target_file';
@@ -161,7 +169,10 @@ class FilesystemTest extends FilesystemTestCase
*/
public function testCopyForOriginUrlsAndExistingLocalFileDefaultsToCopy()
{
$sourceFilePath = 'http://symfony.com/images/common/logo/logo_symfony_header.png';
if (!\in_array('https', stream_get_wrappers())) {
$this->markTestSkipped('"https" stream wrapper is not enabled.');
}
$sourceFilePath = 'https://symfony.com/images/common/logo/logo_symfony_header.png';
$targetFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_target_file';
file_put_contents($targetFilePath, 'TARGET FILE');
@@ -1321,6 +1332,46 @@ class FilesystemTest extends FilesystemTestCase
$this->assertFileNotExists($targetPath.'target');
}
public function testMirrorWithCustomIterator()
{
$sourcePath = $this->workspace.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR;
mkdir($sourcePath);
$file = $sourcePath.DIRECTORY_SEPARATOR.'file';
file_put_contents($file, 'FILE');
$targetPath = $this->workspace.DIRECTORY_SEPARATOR.'target'.DIRECTORY_SEPARATOR;
$splFile = new \SplFileInfo($file);
$iterator = new \ArrayObject(array($splFile));
$this->filesystem->mirror($sourcePath, $targetPath, $iterator);
$this->assertTrue(is_dir($targetPath));
$this->assertFileEquals($file, $targetPath.DIRECTORY_SEPARATOR.'file');
}
/**
* @expectedException \Symfony\Component\Filesystem\Exception\IOException
* @expectedExceptionMessageRegExp /Unable to mirror "(.*)" directory/
*/
public function testMirrorWithCustomIteratorWithRelativePath()
{
$sourcePath = $this->workspace.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR;
$realSourcePath = $this->workspace.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR;
mkdir($realSourcePath);
$file = $realSourcePath.'file';
file_put_contents($file, 'FILE');
$targetPath = $this->workspace.DIRECTORY_SEPARATOR.'target'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'target'.DIRECTORY_SEPARATOR;
$splFile = new \SplFileInfo($file);
$iterator = new \ArrayObject(array($splFile));
$this->filesystem->mirror($sourcePath, $targetPath, $iterator);
}
/**
* @dataProvider providePathsForIsAbsolutePath
*/