Ok I finally found out why this was taking a lot of time.

The problems seem to be inside the PHPUnit engine; my phpunit.xml file
looked like this : 

<filter>
    <whitelist>
      <directory suffix=".php">../application</directory>
      <directory suffix=".php">../library</directory>
      <exclude>
        <directory suffix=".php">../library/Zend</directory>
        <directory suffix=".php">../library/Doctrine</directory>
        <directory suffix=".phtml">../application</directory>
        <file>../application/Bootstrap.php</file>
        <file>../application/scripts/doctrine.php</file>
      </exclude>
    </whitelist>
  </filter>

When you specify a path to the whitelist / blacklist, PHPunit WILL "parse"
everything in it, recursivly, but will not include them in the final result
if they have been "excluded" (or blacklisted).
This also includes every .svn folders and content (which was also my case)
So with this xml bit, every single bit of my libs (including doctrine and
zend) would have been parsed by phpunit.
By changing this xml bit into the following one, my tests now run in 3
seconds (instead of ~50)

<filter>
    <whitelist>
      <directory suffix=".php">../application</directory>
      <directory suffix=".php">../library/lib1_to_test</directory>
      <directory suffix=".php">../library/lib2_to_test</directory>
      <exclude>
        <directory suffix=".phtml">../application</directory>
        <file>../application/Bootstrap.php</file>
        <file>../application/scripts/doctrine.php</file>
      </exclude>
    </whitelist>
  </filter>

I hope this helped you.
-- 
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/PHPUnit-taking-forever-tp2133459p2230316.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to