5

When I try to run a unit test I get an error that SymfonyTestsListener does not exist. Am I running this correctly?

../../vendor/bin/phpunit -c phpunit.xml ../modules/custom/my_module/

Class "Symfony\Bridge\PhpUnit\SymfonyTestsListener" does not exist

I am using PHPUnit 6.5.13.

7

Had a similar issue: Solved it by adding the "symfony/phpunit-bridge": "^3.4.3" library.

3

Removing the line below in phpunit.xml fixes my issue:

<!-- The Symfony deprecation listener has to come after the Drupal listener -->
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
</listener>

Not sure if this will cause any issues.

  • Thanks @albertski this worked for me but don't know why yet... – Beto Aveiga Dec 28 '18 at 21:26
  • Where to comment this? is this line not really required? – ARUN Jan 21 at 8:25
  • This is in phpunit.xml. – albertski Jan 21 at 15:57
  • @ARUN, I needed to modify [web/]core/phpunit.xml.dist. – andileco Jan 28 at 23:34
  • Removing this line will only disable the deprecation listener, the correct answer here is provided by @dragu-alexandru. – mpp May 20 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.