Answer the question
In order to leave comments, you need to log in
How to create tests in laravel?
I decided to write tests for API on Laravel. Got into the documentation https://laravel.com/docs/5.4/http-tests.
I did a test I
cleared Artisan's cache I run
tests php vendor/bin/phpunit
And nothing..
/var/www # php vendor/bin/phpunit
PHPUnit 5.7.21 by Sebastian Bergmann and contributors.
Time: 62 ms, Memory: 4.00MB
No tests executed!
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class APITest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testBasicTest()
{
////
}
}
Answer the question
In order to leave comments, you need to log in
Check the following
- the test file must end with Test
- the name of the test method must start with test or have the annotation /** @test */
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question