SomeNorwegianGuy
SomeNorwegianGuy

Reputation: 1534

phpunit is running a TestCase class

I am using phpunit to unit test a project, and have a class called StdTestCase in the root of the tests that is a superclass for all the test classes.

Out of the blue, phpunit started to try running this class a test class, and I get this warning

1) Warning
No tests found in class "std\tests\StdTestCase".

My config file is present in the root of the project, which is where I run the tests from, with this content.

/phpunit.xml

<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="false"
         stopOnFailure="false"
         syntaxCheck="true"
         bootstrap="./std/tests/bootstrap.php"
        >
    <testsuites>
        <testsuite name="StdTestSuite">
            <directory>./std/tests/</directory>
        </testsuite>
    </testsuites>
</phpunit>

Upvotes: 0

Views: 125

Answers (1)

Evert
Evert

Reputation: 99816

Mark your superclass as abstract, because it clearly is supposed to be.

Upvotes: 3

Related Questions