0

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>

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

1 Comment

This did fix the issue, but it seems that there is some underlying issue that is not being fixed. Should php not ignore every file that does not end with Test.php ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.