Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[PhpUnitBridge] enable DebugClassLoader by default #28412

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

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Sep 9, 2018

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR symfony/symfony-docs#10360

With this PR, the phpunit-bridge will enable DebugClassLoader by default, making it do its job: throw deprecation notices at autoloading time. On top of #28329, this made me spot some glitches in the code base, fixed here also.

This can be disabled by configuring the listener in phpunit.xml.dist files, adding <element key="debug-class-loader"><integer>0</integer></element> next to <element key="time-sensitive">....

@@ -984,8 +984,6 @@ public function setCache(array $options)
* @return $this
*
* @see http://tools.ietf.org/html/rfc2616#section-10.3.5
*
* @final
Copy link
Member Author

@nicolas-grekas nicolas-grekas Sep 9, 2018

Choose a reason for hiding this comment

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

This method is extended in StreamedResponse, so it cannot be final.

Copy link
Member Author

@nicolas-grekas nicolas-grekas Sep 16, 2018

Choose a reason for hiding this comment

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

Removed in favor of #28483

@@ -52,6 +53,8 @@ public function __construct(array $mockedNamespaces = array())
Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait'] = 2;
}

$enableDebugClassLoader = \class_exists('Symfony\Component\Debug\DebugClassLoader');
Copy link
Member Author

@nicolas-grekas nicolas-grekas Sep 9, 2018

Choose a reason for hiding this comment

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

(as a reminder, because we want to use it when testing branch 2.8, the bridge is still compatible with PHP 5.3, so we cannot use ::class here)

Copy link
Contributor

@GuilhemN GuilhemN left a comment

Choose a reason for hiding this comment

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

That's a great improvement 👍

@nicolas-grekas nicolas-grekas force-pushed the phpunit-debug-class-loader branch from 2aa983e to 2fb11fc Compare September 16, 2018 19:55
@nicolas-grekas nicolas-grekas merged commit 2fb11fc into symfony:master Sep 18, 2018
nicolas-grekas added a commit that referenced this pull request Sep 18, 2018
…colas-grekas)

This PR was merged into the 4.2-dev branch.

Discussion
----------

[PhpUnitBridge] enable DebugClassLoader by default

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | symfony/symfony-docs#10360

With this PR, the phpunit-bridge will enable `DebugClassLoader` by default, making it do its job: throw deprecation notices at autoloading time. On top of #28329, this made me spot some glitches in the code base, fixed here also.

This can be disabled by configuring the listener in `phpunit.xml.dist` files, adding `<element key="debug-class-loader"><integer>0</integer></element>` next to `<element key="time-sensitive">...`.

Commits
-------

2fb11fc [PhpUnitBridge] enable DebugClassLoader by default
@nicolas-grekas nicolas-grekas deleted the phpunit-debug-class-loader branch September 18, 2018 17:00
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.2 Nov 1, 2018
This was referenced Nov 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants