Phpunit cannot find tests

PHPunit cannot find my tests, but it finds my XML configuration. This is the config:

<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         bootstrap="vendor/autoload.php"
         colors="false"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="false"
         stopOnFailure="false"
         syntaxCheck="false"
>
    <testsuites>
        <testsuite name="Symply Test Suite">
            <directory>src/Symply/EventManager/Tests</directory>
        </testsuite>
    </testsuites>
</phpunit>

And this is the directory structure:

directory structure PHPunit simply says that when the script runs, "no tests are executed." I do not know why this does not work, as I have specified the directory in the XML catalog tags.

+5
source share
3 answers

I think I get it. When you use PHPunit through the command line, everything works fine. In my opinion, there are some problems with Netbeans. I need to specify the test folder there, so I think I just select the src folder? Thanks to everyone who is trying to help me.

0
source

You need to specify the attribute suffix:

<directory suffix="Test.php">...</directory> 

.

+12

I ran into this problem. This post is a little old, but I thought I would share what I understood by reading this page and looking at it more.

Files in the test directory do not end there * Test.php When I changed them to the format, it worked. It's awesome that you can define your own naming convention by specifying a suffix in xml.

Hope this helps anyone who can read it, but still got a little confused.

+9
source

All Articles