Skip to content
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

phpunit breaks symfony autoloader? #2377

Closed
sc0rp10 opened this issue Dec 1, 2016 · 1 comment
Closed

phpunit breaks symfony autoloader? #2377

sc0rp10 opened this issue Dec 1, 2016 · 1 comment

Comments

@sc0rp10
Copy link

sc0rp10 commented Dec 1, 2016

Hi!
Today I was updated my symfony projects to 3.2 version which contains some changes in Yaml component: It's now can handle PHP constants in code and class Symfony\Component\Yaml\Yaml have new constant PARSE_CONSTANT.
When I ran tests with globally installed phpunit I got error Error: Undefined class constant 'PARSE_CONSTANT' in /tmp/test/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php:396
I add some debug to this line:

if (!defined(Yaml::class.'PARSE_CONSTANT')) {
    $rc = new \ReflectionClass(Yaml::class);
    var_dump($rc->getFileName());
}

And got string phar:///usr/local/Cellar/phpunit/5.6.2/libexec/phpunit-5.6.2.phar/symfony/yaml/Yaml.php what means that class Symfony\Component\Yaml\Yaml was loaded from phpunit's phar, and not from my vendor directory.

I've tried to reproduce this with clean symfony's 3.2 installation with default phpunit.xml and got same error.

I created repository with clean symfony 3.2 and this bug: https://github.com/sc0rp10/phpunit-symfony-issue
Clone it, install vendors and run globally installed phpunit (my version is 5.6.2).

Is it PHPUnit issue or symfony?

@sebastianbergmann
Copy link
Owner

Duplicate of #2015. In the meantime install PHPUnit via Composer.

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

No branches or pull requests

2 participants