vendredi 26 février 2016

PHP laravel 5, No tests executed

I'm trying to write my very first unit test in PHP Laravel 5 framework. As per the documentation followed the steps but it always ended up with

C:\xampp\htdocs\IntelliKid>phpunit
PHPUnit 4.8.21 by Sebastian Bergmann and contributors.

Time: 744 ms, Memory: 3.00Mb

No tests executed!

Below is my test class in the /test directory.

<?php

use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;

class TestSample extends TestCase
{
    /** @test */
    public function testExample()
    {
        echo "MY TEST EXECUTING";
        $this->assertTrue(true);
    }
}

Further, below is my phpunit.xml

<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         bootstrap="bootstrap/autoload.php"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="false"
         stopOnFailure="false">
    <testsuites>
        <testsuite name="Application Test Suite">
            <directory>./tests/</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist>
            <directory suffix=".php">app/</directory>
        </whitelist>
    </filter>
    <php>
        <env name="APP_ENV" value="testing"/>
        <env name="CACHE_DRIVER" value="array"/>
        <env name="SESSION_DRIVER" value="array"/>
        <env name="QUEUE_DRIVER" value="sync"/>
    </php>
</phpunit>

Any help, appreciated. Thanks!

Aucun commentaire:

Enregistrer un commentaire