php – Why PHPUnit into Laravel return "No tests executed!" at execution feature tests-ThrowExceptions

Exception or error:

I have file tests/Feature/InvoicePaymentTest.php, he contains are three tests. First and second are tests is executed correctly. Third test has return “No tests executed!”, and not return error.
illustration of how this happens

My code scheme


namespace Tests\Feature;

// use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;

class SubscriptionInvoicePaymentTest extends TestCase

    public function testFirst()
        // this test correctly exeqted

    public function testSecond()
        // this test correctly exeqted

    public function nextPaymentTest()
        // this test return "No tests executed!" as seen in the screenshot

My phpunit.xml

<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
        <testsuite name="Unit">
            <directory suffix="Test.php">./tests/Unit</directory>

        <testsuite name="Feature">
            <directory suffix="Test.php">./tests/Feature</directory>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./app</directory>
        <env name="APP_ENV" value="testing"/>
        <env name="BCRYPT_ROUNDS" value="4"/>
        <env name="BROADCAST_DRIVER" value="fake"/>
        <env name="CACHE_DRIVER" value="array"/>
        <env name="SESSION_DRIVER" value="array"/>
        <env name="QUEUE_DRIVER" value="sync"/>
        <env name="MAIL_DRIVER" value="array"/>
        <env name="DB_CONNECTION" value="mysql"/>
        <env name="DB_DATABASE" value="dbName"/>
        <env name="TELESCOPE_ENABLED" value="false"/>

What could be the problem? Thank you in advance

How to solve:

In phpunit a method should be either prefixed with test or have the @test annotation in order to be run.

Leave a Reply

Your email address will not be published. Required fields are marked *