Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9283749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T18:42:39+00:00 2026-06-18T18:42:39+00:00

I’m using Symfony 2, PHPUnit 3.7.10 and PhpStorm 5.0.4. I have a class MyTestListener

  • 0

I’m using Symfony 2, PHPUnit 3.7.10 and PhpStorm 5.0.4.

I have a class MyTestListener (implements PHPUnit_Framework_TestListener) in the namespace Acme\DemoBundle\Tests.

When I call phpunit from CLI with vendor/bin/phpunit.bat -c app/
The listener work, the test is successful.

I found this: PHPUnit, PHPUnit_Framework_TestListener, Netbeans and the PHPUnit xml config but it seems to be another problem.

But when I start the test in PhpStorm the, the listener does not load, some objects should be injected into an abstract test class, which are null in this case. I also notices, that when I debug with a breakpoint in the MyTestListener class the debugger doesn’t stop in this class, others breakpoints work fine.

the phpunit.xml entry:

    <listeners>
       <listener class="Acme\DemoBundle\Tests\MyTestListener" file="../src/Acme/DemoBundle/Tests/MyTestListener.php">
       </listener>
    </listeners>

I also try to add a empty element, it doesn’t help.

In my Run/Debug Configuration of PhpStorm I specify phpunit.xml and the bootstrap file.
I also add this option for the Command Line/Interpreter: -d auto_prepend_file=vendor/autoload.php

The listener configuration in phpunit.xml seems to be parsed, but not work. When I change the class name to an invalid file/class, I get an error, that the file can’t open the stream. I also try to use a absolute file path or change the slashes into backslashes, nothing works.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T18:42:40+00:00Added an answer on June 18, 2026 at 6:42 pm

    What a shame… I found my own error

    I do all tests from CLI, but in PhpStorm only one test class, so the suite name was different and in my listener class I do the stuff only if the suite name match:

    if ($suite->getName() == "db-tests") {...}
    

    So the solution was to extends the expression to

    $name = $suite->getName();
    if ($name == "db-tests" || 
       strpos($name, 'Acme\DemoBundle\Tests\Database') !== false) {...}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have thousands of HTML files to process using Groovy/Java and I need to
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am using JSon response to parse title,date content and thumbnail images and place
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.