Skip to content

Error when running TestSuite #811

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

Closed
christiansiewert opened this issue Jun 17, 2018 · 8 comments
Closed

Error when running TestSuite #811

christiansiewert opened this issue Jun 17, 2018 · 8 comments

Comments

@christiansiewert
Copy link

christiansiewert commented Jun 17, 2018

A fresh installation of this project gives me this when running the tests:

bash-4.3$ vendor/bin/simple-phpunit 
PHP Fatal error:  Declaration of DAMA\DoctrineTestBundle\PHPUnit\PHPUnitListener::startTestSuite(PHPUnit\Framework\TestSuite $suite) must be compatible with PHPUnit_Framework_TestListener::startTestSuite(PHPUnit_Framework_TestSuite $suite) in /var/www/html/vendor/dama/doctrine-test-bundle/src/DAMA/DoctrineTestBundle/PHPUnit/PHPUnitListener.php on line 9
PHP Stack trace:
PHP   1. {main}() /var/www/html/vendor/symfony/phpunit-bridge/bin/simple-phpunit:0
PHP   2. include() /var/www/html/vendor/symfony/phpunit-bridge/bin/simple-phpunit:280
PHP   3. PHPUnit_TextUI_Command::main() /var/www/html/vendor/bin/.phpunit/phpunit-5.7/phpunit:17
PHP   4. PHPUnit_TextUI_Command->run() /var/www/html/vendor/bin/.phpunit/phpunit-5.7/src/TextUI/Command.php:116
PHP   5. PHPUnit_TextUI_TestRunner->doRun() /var/www/html/vendor/bin/.phpunit/phpunit-5.7/src/TextUI/Command.php:186
PHP   6. Symfony\Bridge\PhpUnit\Legacy\TestRunnerForV5->handleConfiguration() /var/www/html/vendor/bin/.phpunit/phpunit-5.7/src/TextUI/TestRunner.php:163
PHP   7. PHPUnit_TextUI_TestRunner->handleConfiguration() /var/www/html/vendor/symfony/phpunit-bridge/Legacy/TestRunnerForV5.php:28
PHP   8. class_exists() /var/www/html/vendor/bin/.phpunit/phpunit-5.7/src/TextUI/TestRunner.php:931
PHP   9. spl_autoload_call() /var/www/html/vendor/bin/.phpunit/phpunit-5.7/src/TextUI/TestRunner.php:931
PHP  10. Composer\Autoload\ClassLoader->loadClass() /var/www/html/vendor/bin/.phpunit/phpunit-5.7/src/TextUI/TestRunner.php:931
PHP  11. Composer\Autoload\includeFile() /var/www/html/vendor/bin/.phpunit/phpunit-5.7/vendor/composer/ClassLoader.php:322
PHP  12. include() /var/www/html/vendor/bin/.phpunit/phpunit-5.7/vendor/composer/ClassLoader.php:444

PHP version is 7.1.9. Any ideas?

Best,
Christian

@dmaicher
Copy link
Contributor

I cannot reproduce this. Seems somehow for you its using the wrong (not-maintained) phpunit version 5?

For me PHPUnit 6.5.8 is used and the tests pass fine.

@dmaicher
Copy link
Contributor

Ah ok this happens only for PHP 7.1. I just tested it for PHP 7.2 and it works fine.

@siewert87 can you test this change?

diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index d545bf4..d916ef2 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -22,6 +22,8 @@
         <!-- ###+ symfony/swiftmailer-bundle ### -->
         <env name="MAILER_URL" value="null://localhost"/>
         <!-- ###- symfony/swiftmailer-bundle ### -->
+
+        <env name="SYMFONY_PHPUNIT_VERSION" value="6.3"/>
     </php>
 
     <testsuites>

@christiansiewert
Copy link
Author

christiansiewert commented Jun 18, 2018

You sir, are a lifesaver. ;) The tests are running now, but shouldn't this work out-of-the-box without this hack?

@dmaicher
Copy link
Contributor

@siewert87 yes indeed 👍 Will create a PR with a fix soon 😉

@dmaicher
Copy link
Contributor

@siewert87 you can re-open the issue in the meantime

@christiansiewert
Copy link
Author

christiansiewert commented Jun 18, 2018 via email

@christiansiewert
Copy link
Author

I reopened the issue, @dmaicher.

javiereguiluz added a commit that referenced this issue Jun 19, 2018
… (dmaicher)

This PR was merged into the master branch.

Discussion
----------

require phpunit 7.1 via SYMFONY_PHPUNIT_VERSION env variable

Fixes #811

When running the test suite on php 7.1 the wrong phpunit (non-maintained version 5) is required by the simple-phpunit-bridge which is not compatible with https://github.com/dmaicher/doctrine-test-bundle-demo.

Commits
-------

1b61f15 require phpunit 7.1 via SYMFONY_PHPUNIT_VERSION env variable
@christiansiewert
Copy link
Author

Thank you, @javiereguiluz and @dmaicher. 👍

sayjun0505 added a commit to sayjun0505/sym_proj that referenced this issue Apr 16, 2023
… (dmaicher)

This PR was merged into the master branch.

Discussion
----------

require phpunit 7.1 via SYMFONY_PHPUNIT_VERSION env variable

Fixes symfony/demo#811

When running the test suite on php 7.1 the wrong phpunit (non-maintained version 5) is required by the simple-phpunit-bridge which is not compatible with https://github.com/dmaicher/doctrine-test-bundle-demo.

Commits
-------

1b61f15 require phpunit 7.1 via SYMFONY_PHPUNIT_VERSION env variable
spider-yamet added a commit to spider-yamet/sym_proj that referenced this issue Apr 16, 2023
… (dmaicher)

This PR was merged into the master branch.

Discussion
----------

require phpunit 7.1 via SYMFONY_PHPUNIT_VERSION env variable

Fixes symfony/demo#811

When running the test suite on php 7.1 the wrong phpunit (non-maintained version 5) is required by the simple-phpunit-bridge which is not compatible with https://github.com/dmaicher/doctrine-test-bundle-demo.

Commits
-------

1b61f15 require phpunit 7.1 via SYMFONY_PHPUNIT_VERSION env variable
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