-
Notifications
You must be signed in to change notification settings - Fork 186
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
use namespaced PHPUnit and keep B.C. #55
Conversation
Psr/Log/Test/LoggerInterfaceTest.php
Outdated
@@ -2,16 +2,21 @@ | |||
|
|||
namespace Psr\Log\Test; | |||
|
|||
if (!class_exists('\\PHPUnit_Framework_TestCase', true)) { |
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.
This does not make sense. You are creating an alias only when the old name does not exist (i.e. in PHPUnit 6+) while you use only the new name.
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.
Sorry, my bad...
I fixed it. Could you review it again?
currently, the repo does not have a So I suggest either keeping this alias out (PHPUnit namespaced classes are available in 4.8.35+, 5.4+ and 6+) or excluding tests from the archive. @Seldaek what do you think ? |
IMO at this point we could merge it without the alias.. This only affects implementors of the PSR which isn't a whole lot of people. |
Psr/Log/Test/LoggerInterfaceTest.php
Outdated
@@ -2,16 +2,21 @@ | |||
|
|||
namespace Psr\Log\Test; | |||
|
|||
if (!class_exists('\\PHPUnit\\Framework\\TestCase', true)) { |
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.
Class names in PHP shouldn't have the leading slash when written in a string. The implementation of class_exist effectively does an ltrim to remove that slash before continuing. The reason why you might see leading slashes is when the ::class notation is used, because then we are resolving names relative to the current namespace.
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.
Thanks! fixed. e50f69c
Looks good to me now, @stof is the new alias ok or does your comment above still apply regarding IDE confusion? |
This is an alternate solution to #52