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

Composer-Installed PHPUnit is used when trying to use PHPUnit from a PHAR #1599

Closed
sebastianbergmann opened this issue Feb 5, 2015 · 1 comment

Comments

@sebastianbergmann
Copy link
Owner

sebastianbergmann commented Feb 5, 2015

When PHPUnit is installed via Composer and Composer's vendor/autoload.php is used as PHPUnit's bootstrap then the Composer-installed PHPUnit will be used instead of the one actually invoked, for instance one invoked from a PHAR:

$ cat composer.json 
{
    "require-dev": {
        "phpunit/phpunit": "~3.7"
    }
}


$ ./vendor/bin/phpunit --version
PHPUnit 3.7.38 by Sebastian Bergmann.


$ php phpunit.phar --version    
PHPUnit 4.4.5 by Sebastian Bergmann.


$ php phpunit.phar --bootstrap vendor/autoload.php tests
PHPUnit 3.7.38 by Sebastian Bergmann.

Configuration read from /home/sb/test/phpunit.xml

.
.
.
@sun

This comment has been minimized.

Copy link
Contributor

sun commented Feb 5, 2015

That's the expected behavior currently, isn't it?

It was discussed in one of the existing issues already. The only way to "force" the code of the .phar would be to front-load all PHPUnit files into memory, so that the classloader is no longer triggered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.