-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Filesystem | WCM] 9339 fix stat on url for filesystem copy #9899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,6 +167,19 @@ public function testCopyCreatesTargetDirectoryIfItDoesNotExist() | |
$this->assertEquals('SOURCE FILE', file_get_contents($targetFilePath)); | ||
} | ||
|
||
public function testCopyForOriginUrlsAndExistingLocalFileDefaultsToNotCopy() | ||
{ | ||
$sourceFilePath = 'http://symfony.com/images/common/logo/logo_symfony_header.png'; | ||
$targetFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_target_file'; | ||
|
||
file_put_contents($targetFilePath, 'TARGET FILE'); | ||
|
||
$this->filesystem->copy($sourceFilePath, $targetFilePath, false); | ||
|
||
$this->assertFileExists($targetFilePath); | ||
$this->assertEquals(file_get_contents($sourceFilePath), file_get_contents($targetFilePath)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmm... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
is not for files on the web with
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TBH. I'm not sure it's good to try to download files from remote servers anyway... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is not good, but there is not another way when testing this functionality, these and others are the slowest tests ever that make symfony test suite very slow There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO better approach would be like with i.e. Behat, start server on Travis-CI (Apache, nginx, whatever...) and give fixtures to be downloaded, it would be for sure more safe, and maybe even faster. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. great call, creating the ticket to be worked on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
|
||
public function testMkdirCreatesDirectoriesRecursively() | ||
{ | ||
$directory = $this->workspace | ||
|
@@ -336,7 +349,7 @@ public function testRemoveCleansInvalidLinks() | |
|
||
mkdir($basePath); | ||
mkdir($basePath.'dir'); | ||
// create symlink to unexisting file | ||
// create symlink to nonexistent file | ||
@symlink($basePath.'file', $basePath.'link'); | ||
|
||
$this->filesystem->remove($basePath); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be
null === blablabla
IIRC.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true, sending the PR, thank you chief @stloyd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#9906