sebastianbergmann / phpunit

The PHP Unit Testing framework.
https://phpunit.de/
BSD 3-Clause "New" or "Revised" License
19.68k stars 2.2k forks source link

phpunit now incompatible with Symfony3.1 #2201

Closed trq closed 8 years ago

trq commented 8 years ago

As noted here here and here, phpunit can no longer be installed as a dev dependency of a Symfony 3.1 app.

Are there any plans to bump the prophecy version to 1.6.1 anytime soon?

Anything I could do to help this happen?

GrahamCampbell commented 8 years ago

It doesn't need "bumping" surely. We just need a new release with the deps updated?

sebastianbergmann commented 8 years ago

I do not see how this is a PHPUnit problem and what I could do about that.

GrahamCampbell commented 8 years ago

@sebastianbergmann I think it's with reference to the dependencies included in the phars you ship?

trq commented 8 years ago

@sebastianbergmann Not necessarily a phpunit issue, but you are the only one in a position to fix. If phpunit relied on 1.6.1 of prophecy the issue would be resolved all round.

GrahamCampbell commented 8 years ago

PHPUnit's version constraint on prophecy already allows their latest 1.6.1 to be installed, and I don't think it needs any changes to PHPUnit's code since prophecy's API has remained the same.

sebastianbergmann commented 8 years ago

PHPUnit pulls in the latest version of Prophecy:

$ ant
Buildfile: /usr/local/src/phpunit/build.xml

clean:
   [delete] Deleting directory /usr/local/src/phpunit/vendor
   [delete] Deleting: /usr/local/src/phpunit/composer.lock

-dependencies-installed:

validate-composer-json:
 [composer] /usr/local/src/phpunit/composer.json is valid

install-dependencies:
 [composer] Loading composer repositories with package information
 [composer] Updating dependencies (including require-dev)
 [composer]   - Installing sebastian/version (2.0.0)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing sebastian/environment (1.3.7)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing sebastian/code-unit-reverse-lookup (1.0.0)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing phpunit/php-text-template (1.2.1)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing phpunit/php-token-stream (1.4.8)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing phpunit/php-file-iterator (1.4.1)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing phpunit/php-code-coverage (4.0.0)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing sebastian/recursion-context (1.0.2)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing sebastian/exporter (1.2.1)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing doctrine/instantiator (1.0.5)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing phpunit/phpunit-mock-objects (3.2.1)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing sebastian/object-enumerator (1.0.0)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing sebastian/resource-operations (1.0.0)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing phpunit/php-timer (1.0.8)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing sebastian/diff (1.4.1)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing sebastian/comparator (1.2.0)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing webmozart/assert (1.0.2)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing phpdocumentor/reflection-common (1.0)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing phpdocumentor/type-resolver (0.1.8)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing phpdocumentor/reflection-docblock (3.0.2)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing phpspec/prophecy (v1.6.1)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing symfony/yaml (v3.1.0)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing sebastian/global-state (1.1.1)
 [composer]     Loading from cache
 [composer] 
 [composer]   - Installing myclabs/deep-copy (1.5.1)
 [composer]     Loading from cache
 [composer] 
 [composer] sebastian/global-state suggests installing ext-uopz (*)
 [composer] Writing lock file
 [composer] Generating autoload files

setup:

BUILD SUCCESSFUL
Total time: 3 seconds

What am I missing?

trq commented 8 years ago

Sorry, for some reason it wasn't for me:

Dependency resolution completed in 0.439 seconds
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: remove symfony/symfony v3.1.0
    - Conclusion: don't install symfony/symfony v3.1.0
    - phpunit/phpunit 5.4.0 requires phpspec/prophecy ^1.3.1 -> satisfiable by phpspec/prophecy[1.4.0, v1.3.1, v1.4.1, v1.5.0, v1.6.0].
    - phpunit/phpunit 5.4.1 requires phpspec/prophecy ^1.3.1 -> satisfiable by phpspec/prophecy[1.4.0, v1.3.1, v1.4.1, v1.5.0, v1.6.0].
    - phpunit/phpunit 5.4.2 requires phpspec/prophecy ^1.3.1 -> satisfiable by phpspec/prophecy[1.4.0, v1.3.1, v1.4.1, v1.5.0, v1.6.0].
    - phpspec/prophecy 1.4.0 requires phpdocumentor/reflection-docblock ~2.0 -> satisfiable by phpdocumentor/reflection-docblock[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4].
    - phpspec/prophecy v1.3.1 requires phpdocumentor/reflection-docblock ~2.0 -> satisfiable by phpdocumentor/reflection-docblock[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4].
    - phpspec/prophecy v1.4.1 requires phpdocumentor/reflection-docblock ~2.0 -> satisfiable by phpdocumentor/reflection-docblock[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4].
    - phpspec/prophecy v1.5.0 requires phpdocumentor/reflection-docblock ~2.0 -> satisfiable by phpdocumentor/reflection-docblock[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4].
    - phpspec/prophecy v1.6.0 requires phpdocumentor/reflection-docblock ~2.0 -> satisfiable by phpdocumentor/reflection-docblock[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4].
    - phpdocumentor/reflection-docblock 2.0.0 conflicts with symfony/symfony[v3.1.0].
    - phpdocumentor/reflection-docblock 2.0.1 conflicts with symfony/symfony[v3.1.0].
    - phpdocumentor/reflection-docblock 2.0.2 conflicts with symfony/symfony[v3.1.0].
    - phpdocumentor/reflection-docblock 2.0.3 conflicts with symfony/symfony[v3.1.0].
    - phpdocumentor/reflection-docblock 2.0.4 conflicts with symfony/symfony[v3.1.0].
    - Installation request for symfony/symfony ^3.1.0 -> satisfiable by symfony/symfony[v3.1.0].
    - Installation request for phpunit/phpunit ^5.4 -> satisfiable by phpunit/phpunit[5.4.0, 5.4.1, 5.4.2].

I'll do a bit more work.

GrahamCampbell commented 8 years ago

Clear your composer cache, and it'll work.

GrahamCampbell commented 8 years ago

I'm going to take the standard composer file from the 3.1 branch of https://github.com/symfony/symfony-standard, and add phpunit to it, and try to run composer, and see what happens.

My test composer.json:

{
    "name": "symfony/framework-standard-edition",
    "require": {
        "php": "^7.0",
        "symfony/symfony": "3.1.*",
        "doctrine/orm": "^2.5",
        "doctrine/doctrine-bundle": "^1.6",
        "doctrine/doctrine-cache-bundle": "^1.2",
        "symfony/swiftmailer-bundle": "^2.3",
        "symfony/monolog-bundle": "^2.8",
        "symfony/polyfill-apcu": "^1.0",
        "sensio/distribution-bundle": "^5.0",
        "sensio/framework-extra-bundle": "^3.0.2",
        "incenteev/composer-parameter-handler": "^2.0"
    },
    "require-dev": {
        "sensio/generator-bundle": "^3.0",
        "symfony/phpunit-bridge": "^3.0",
        "phpunit/phpunit": "^5.4"
    }
}
GrahamCampbell commented 8 years ago

Worked fine:

Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing psr/cache (1.0.0)
    Downloading: 100%

  - Installing symfony/polyfill-util (v1.2.0)
    Downloading: 100%

  - Installing paragonie/random_compat (v2.0.2)
    Downloading: 100%

  - Installing symfony/polyfill-php70 (v1.2.0)
    Downloading: 100%

  - Installing symfony/polyfill-php56 (v1.2.0)
    Downloading: 100%

  - Installing symfony/polyfill-mbstring (v1.2.0)
    Downloading: 100%

  - Installing symfony/symfony (v3.1.0)
    Downloading: 100%

  - Installing symfony/polyfill-intl-icu (v1.2.0)
    Downloading: 100%

  - Installing psr/log (1.0.0)
    Downloading: 100%

  - Installing twig/twig (v1.24.1)
    Downloading: 100%

  - Installing doctrine/lexer (v1.0.1)
    Downloading: 100%

  - Installing doctrine/annotations (v1.2.7)
    Downloading: 100%

  - Installing doctrine/collections (v1.3.0)
    Downloading: 100%

  - Installing doctrine/cache (v1.6.0)
    Downloading: 100%

  - Installing doctrine/inflector (v1.1.0)
    Downloading: 100%

  - Installing doctrine/common (v2.6.1)
    Downloading: 100%

  - Installing incenteev/composer-parameter-handler (v2.1.2)
    Downloading: 100%

  - Installing doctrine/instantiator (1.0.5)
    Downloading: 100%

  - Installing doctrine/dbal (v2.5.4)
    Downloading: 100%

  - Installing doctrine/orm (v2.5.4)
    Downloading: 100%

  - Installing doctrine/doctrine-cache-bundle (1.3.0)
    Downloading: 100%

  - Installing jdorn/sql-formatter (v1.2.17)
    Downloading: 100%

  - Installing symfony/polyfill-apcu (v1.2.0)
    Downloading: 100%

  - Installing doctrine/doctrine-bundle (1.6.3)
    Downloading: 100%

  - Installing swiftmailer/swiftmailer (v5.4.2)
    Downloading: 100%

  - Installing symfony/swiftmailer-bundle (v2.3.11)
    Downloading: 100%

  - Installing monolog/monolog (1.19.0)
    Downloading: 100%

  - Installing symfony/monolog-bundle (2.11.1)
    Downloading: 100%

  - Installing sensiolabs/security-checker (v3.0.2)
    Downloading: 100%

  - Installing sensio/distribution-bundle (v5.0.6)
    Downloading: 100%

  - Installing sensio/framework-extra-bundle (v3.0.16)
    Downloading: 100%

  - Installing sensio/generator-bundle (v3.0.6)
    Downloading: 100%

  - Installing symfony/phpunit-bridge (v3.1.0)
    Downloading: 100%

  - Installing myclabs/deep-copy (1.5.1)
    Downloading: 100%

  - Installing sebastian/version (2.0.0)
    Downloading: 100%

  - Installing sebastian/resource-operations (1.0.0)
    Downloading: 100%

  - Installing sebastian/recursion-context (1.0.2)
    Downloading: 100%

  - Installing sebastian/object-enumerator (1.0.0)
    Downloading: 100%

  - Installing sebastian/global-state (1.1.1)
    Downloading: 100%

  - Installing sebastian/exporter (1.2.1)
    Downloading: 100%

  - Installing sebastian/environment (1.3.7)
    Downloading: 100%

  - Installing sebastian/diff (1.4.1)
    Downloading: 100%

  - Installing sebastian/comparator (1.2.0)
    Downloading: 100%

  - Installing webmozart/assert (1.0.2)
    Downloading: 100%

  - Installing phpdocumentor/reflection-common (1.0)
    Downloading: 100%

  - Installing phpdocumentor/type-resolver (0.1.8)
    Downloading: 100%

  - Installing phpdocumentor/reflection-docblock (3.0.2)
    Downloading: 100%

  - Installing phpspec/prophecy (v1.6.1)
    Downloading: 100%

  - Installing phpunit/php-text-template (1.2.1)
    Downloading: 100%

  - Installing phpunit/phpunit-mock-objects (3.2.1)
    Downloading: 100%

  - Installing phpunit/php-timer (1.0.8)
    Downloading: 100%

  - Installing sebastian/code-unit-reverse-lookup (1.0.0)
    Downloading: 100%

  - Installing phpunit/php-token-stream (1.4.8)
    Downloading: 100%

  - Installing phpunit/php-file-iterator (1.4.1)
    Downloading: 100%

  - Installing phpunit/php-code-coverage (4.0.0)
    Downloading: 100%

  - Installing phpunit/phpunit (5.4.2)
    Downloading: 100%

paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
symfony/polyfill-intl-icu suggests installing ext-intl (For best performance)
doctrine/doctrine-cache-bundle suggests installing symfony/security-acl (For using this bundle to cache ACLs)
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing raven/raven (Allow sending log messages to a Sentry server)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing php-amqplib/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages to a MongoDB server via PHP Driver)
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)
sensio/framework-extra-bundle suggests installing symfony/psr-http-message-bridge (To use the PSR-7 converters)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit-mock-objects suggests installing ext-soap (*)
phpunit/php-code-coverage suggests installing ext-xdebug (>=2.4.0)
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
Writing lock file
Generating autoload files
GrahamCampbell commented 8 years ago

Clear your composer cache, and it'll work.

Sorry, the command is composer clear-cache. You might also want to rm -rf composer.lock vendor first too, because composer will use that as a cache to try to lessen the computation to resolve dependencies, but that can sometimes result in incorrect resolution.

trq commented 8 years ago

Thanks @GrahamCampbell I've had issues with that cache all afternoon. Trying to do a symfony 2.8 -> 3.1 upgrade.

GrahamCampbell commented 8 years ago

No problem. :)

teohhanhui commented 8 years ago

@sebastianbergmann Appreciate if you could release an updated PHAR which includes phpspec/prophecy v1.6.1

It's especially useful for Travis CI builds...