8000 Symfony\Component\ClassLoader\ClassMapGenerator dump test by eventhorizonpl · Pull Request #5330 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 1 commit into from
Aug 28, 2012
Merged

Symfony\Component\ClassLoader\ClassMapGenerator dump test #5330

merged 1 commit into from
Aug 28, 2012

Conversation

eventhorizonpl
Copy link

Hi,

100 percent test coverage for ClassMapGenerator :)

Best regards,
Michal


public function setUp()
{
$this->workspace = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.time().rand(0, 1000);
Copy link
Member

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

Copy link
Member

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?

@eventhorizonpl
Copy link
Author

Fixed, thanks for the review!

*/
public function testDump($directory, $expected)
{
$file = $this->workspace.DIRECTORY_SEPARATOR.'file';
Copy link
Contributor

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

Copy link
Author

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 :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Member

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 :)

Copy link
Contributor

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

@travisbot
Copy link

This pull request passes (merged 9efe4cfc into 2cf3cb5).

@travisbot
Copy link

This pull request passes (merged 1af9e60a into a1e6cfb).

fix things pointed out by stof

fix things pointed out by pborreli

fix things pointed out by fabpot
@travisbot
Copy link

This pull request fails (merged f1970fa into 2c0e851).

fabpot added a commit that referenced this pull request Aug 28, 2012
…(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!
@fabpot fabpot merged commit f1970fa into symfony:master Aug 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0