-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Symfony\Component\ClassLoader\ClassMapGenerator dump test #5330
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
Symfony\Component\ClassLoader\ClassMapGenerator dump test #5330
Conversation
|
||
public function setUp() | ||
{ | ||
$this->workspace = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.time().rand(0, 1000); |
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.
you should delete it on tearDown
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.
It would be better to not do that in the setUp method as most of the tests do not use this. What about just creating the directory when you actually need it?
Fixed, thanks for the review! |
*/ | ||
public function testDump($directory, $expected) | ||
{ | ||
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
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.
don't see why you are using DIRECTORY_SEPARATOR here, windows has no problem to deal with /
in file paths
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.
I did it because it's how FilesystemTest is written. I don't know much about PHP issues on Windows and I don't want to reinvent the wheel :)
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.
ok
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.
the only places were we have to use DIRECTORY_SEPARATOR is when we do a string comparison with a path (which is done in FilesystemTest), as string definitely have an issue to consider /
and \
being equivalent :)
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.
or for this for example : rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR)
but if you start to use it everytime you have to deal with paths, it becomes crazy
…(PR #5330) Commits ------- f1970fa dump test Discussion ---------- Symfony\Component\ClassLoader\ClassMapGenerator dump test Hi, 100 percent test coverage for ClassMapGenerator :) Best regards, Michal --------------------------------------------------------------------------- by eventhorizonpl at 2012-08-24T07:47:24Z Fixed, thanks for the review!
Hi,
100 percent test coverage for ClassMapGenerator :)
Best regards,
Michal