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

Version 1.3.2+ breaks tests for PHP-DI 5.2 (and also latest stable 5.3) #13

Closed
siwinski opened this issue Jul 26, 2016 · 4 comments
Closed

Comments

@siwinski
Copy link

siwinski commented Jul 26, 2016

Installing the latest possible php-di/php-di on CentOS/RHEL 7 (because of PHP version 5.4.16), which is 5.2.2, fails starting with php-di/invoker version 1.3.2

$ cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.2 (Maipo)

$ php --version
PHP 5.4.16 (cli) (built: Apr  4 2016 07:13:18) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

$ cd /tmp

$ rm -rf PHP-DI

$ git clone https://github.com/PHP-DI/PHP-DI.git
Cloning into 'PHP-DI'...
remote: Counting objects: 31992, done.
remote: Total 31992 (delta 0), reused 0 (delta 0), pack-reused 31991
Receiving objects: 100% (31992/31992), 39.70 MiB | 5.08 MiB/s, done.
Resolving deltas: 100% (15140/15140), done.

$ cd PHP-DI

$ git checkout 5.2.2
Note: checking out '5.2.2'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at f574bcc... Add tests covering #379

$ composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing php-di/phpdoc-reader (2.0.1)
    Loading from cache

  - Installing container-interop/container-interop (1.1.0)
    Loading from cache

  - Installing php-di/invoker (1.3.3)
    Loading from cache

  - Installing symfony/yaml (v2.8.8)
    Loading from cache

  - Installing sebastian/version (1.0.6)
    Loading from cache

  - Installing sebastian/global-state (1.1.1)
    Loading from cache

  - Installing sebastian/recursion-context (1.0.2)
    Loading from cache

  - Installing sebastian/exporter (1.2.2)
    Loading from cache

  - Installing sebastian/environment (1.3.7)
    Loading from cache

  - Installing sebastian/diff (1.4.1)
    Loading from cache

  - Installing sebastian/comparator (1.2.0)
    Loading from cache

  - Installing doctrine/instantiator (1.0.5)
    Loading from cache

  - Installing phpunit/php-text-template (1.2.1)
    Loading from cache

  - Installing phpunit/phpunit-mock-objects (2.3.8)
    Loading from cache

  - Installing phpunit/php-timer (1.0.8)
    Loading from cache

  - Installing phpunit/php-file-iterator (1.4.1)
    Loading from cache

  - Installing phpunit/php-token-stream (1.4.8)
    Loading from cache

  - Installing phpunit/php-code-coverage (2.2.4)
    Loading from cache

  - Installing phpdocumentor/reflection-docblock (2.0.4)
    Loading from cache

  - Installing phpspec/prophecy (v1.6.1)
    Loading from cache

  - Installing phpunit/phpunit (4.8.27)
    Loading from cache

  - Installing mnapoli/phpunit-easymock (0.2.3)
    Loading from cache

  - Installing doctrine/cache (v1.5.4)
    Loading from cache

  - Installing doctrine/lexer (v1.0.1)
    Loading from cache

  - Installing doctrine/annotations (v1.2.7)
    Loading from cache

  - Installing zendframework/zend-stdlib (2.5.1)
    Loading from cache

  - Installing zendframework/zend-eventmanager (2.5.1)
    Loading from cache

  - Installing zendframework/zend-code (2.5.1)
    Loading from cache

  - Installing ocramius/proxy-manager (1.0.2)
    Loading from cache

sebastian/global-state suggests installing ext-uopz (*)
phpunit/php-code-coverage suggests installing ext-xdebug (>=2.2.1)
phpdocumentor/reflection-docblock suggests installing dflydev/markdown (~1.0)
phpdocumentor/reflection-docblock suggests installing erusev/parsedown (~1.0)
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
zendframework/zend-stdlib suggests installing zendframework/zend-serializer (Zend\Serializer component)
zendframework/zend-stdlib suggests installing zendframework/zend-servicemanager (To support hydrator plugin manager usage)
zendframework/zend-stdlib suggests installing zendframework/zend-filter (To support naming strategy hydrator usage)
zendframework/zend-code suggests installing doctrine/common (Doctrine\Common >=2.1 for annotation features)
ocramius/proxy-manager suggests installing ocramius/generated-hydrator (To have very fast object to array to object conversion for ghost objects)
ocramius/proxy-manager suggests installing zendframework/zend-xmlrpc (To have the XmlRpc adapter (Remote Object feature))
ocramius/proxy-manager suggests installing zendframework/zend-json (To have the JsonRpc adapter (Remote Object feature))
ocramius/proxy-manager suggests installing zendframework/zend-soap (To have the Soap adapter (Remote Object feature))
Writing lock file
Generating autoload files

$ ./vendor/bin/phpunit
PHPUnit 4.8.27 by Sebastian Bergmann and contributors.

...............................................................  63 / 419 ( 15%)
............................................................... 126 / 419 ( 30%)
............................................................... 189 / 419 ( 45%)
..........F.................................................... 252 / 419 ( 60%)
............................................................... 315 / 419 ( 75%)
..F.....................................F.....................F 378 / 419 ( 90%)
.........................................

Time: 327 ms, Memory: 20.00MB

There were 4 failures:

1) DI\Test\UnitTest\Definition\Resolver\FactoryResolverTest::should_throw_if_the_factory_is_not_callable
Failed asserting that exception message 'Entry "foo" cannot be resolved: factory NULL is neither a callable nor a valid container entry' contains 'Entry "foo" cannot be resolved: factory "Hello world" is neither a callable nor a valid container entry'.

2) DI\Test\IntegrationTest\CallFunctionTest::test_not_callable
Failed asserting that exception message ''foo' is neither a callable nor a valid container entry' contains '"foo" is neither a callable nor a valid container entry'.

3) DI\Test\IntegrationTest\Definitions\FactoryDefinitionTest::test_not_callable_factory_definition
Failed asserting that exception message 'Entry "foo" cannot be resolved: factory 'Hello World' is neither a callable nor a valid container entry' contains 'Entry "foo" cannot be resolved: factory "Hello World" is neither a callable nor a valid container entry'.

4) DI\Test\IntegrationTest\ErrorMessages\ErrorMessagesTest::test_factory_not_callable
Failed asserting that exception message 'Entry "foo" cannot be resolved: factory 'bar' is neither a callable nor a valid container entry' contains 'Entry "foo" cannot be resolved: factory "bar" is neither a callable nor a valid container entry'.

FAILURES!
Tests: 419, Assertions: 1091, Failures: 4.

php-di/invoker test matrix with php-di/php-di 5.2.2 (same for 5.3.0):

1.3.0 1.3.1 1.3.2 1.3.3
pass pass fail fail

Per php-di/php-di 5.2.2 (and 5.3.0) composer.json, "php-di/invoker": "^1.1.1" is required so php-di/invoker 1.3.2+ should work since composer installs them.

@siwinski
Copy link
Author

FYI: I noticed this after updating downstream-packaged php-di/invoker from 1.3.0 to 1.3.3

Downstream bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1360418

@mnapoli mnapoli changed the title Version 1.3.2+ breaks PHP-DI 5.2 (and also latest stable 5.3) Version 1.3.2+ breaks tests for PHP-DI 5.2 (and also latest stable 5.3) Jul 26, 2016
@mnapoli
Copy link
Member

mnapoli commented Jul 26, 2016

Thanks for the report. I just want to correct that PHP-DI doesn't really break, it's just some test assertions on exception messages that now fail because some quotes where changed. So tests fails indeed, but AFAICT the code works fine. I don't think there's anything to "fix" in that repository.

Correct me if I'm wrong but it's an issue for you for release management? If so, how could I help you solve that? I'm not sure of what I can do to help.

@siwinski
Copy link
Author

Thanks for the quick reply @mnapoli !

I'm sorry. I did not have time to dig into the errors so I assumed that since the test suite failed the library itself failed. Sorry for the assumption.

Since you clarified that is is ONLY the tests that fail, I can just skip those tests. Thanks for the clarification. I'm closing this issue.

@mnapoli
Copy link
Member

mnapoli commented Jul 27, 2016

👍 no worries thanks for taking the time to report it

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