Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phpunit no tests executed

Tags:

php

phpunit

I have a 'No tests executed' with phpunit..

This line works

$ phpunit install/InstallDbTest.php
...
<result expected>
...

$ cat suites/installtests.xml   
<phpunit>
    <testsuites>
        <testsuite name="database">
            <file>install/InstallDbTest.php</file>
        </testsuite>
    </testsuites>
</phpunit>

$ phpunit -c suites/installtests.xml 
PHPUnit 4.7.4 by Sebastian Bergmann and contributors.



Time: 130 ms, Memory: 11.25Mb

No tests executed!

Does anyone can tell me what I am doing wrong ?

Thanks in advance!

like image 960
nsvir Avatar asked Sep 08 '26 04:09

nsvir


1 Answers

You need to correct the path in your phpunit.xml.

It is trying to find the filesuites/install/InstallDbTest.php. Since the file doesn't exist, no tests are run and you get the message.

Change the configuration to the following:

<phpunit>
    <testsuites>
        <testsuite name="database">
            <file>../install/InstallDbTest.php</file>
        </testsuite>
    </testsuites>
</phpunit>

File paths in phpunit.xml are all relative to the location of the xml file.

like image 134
Schleis Avatar answered Sep 10 '26 08:09

Schleis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!