PHPUnit show errors but not show successful alert

66 views Asked by At

I use Laravel 5.8 and phphunit version 7.5. When I run PHPUnit with error, show me error but when not has error show me only this line

PHPUnit 7.5.0 by Sebastian Bergmann and contributors. My test class:

use Tests\TestCase;

class leadTest extends TestCase
{
    public $Array= ['lead_name' => 'Jon','lead_family'=>'Doe'];
    public function test_store()
    {
        $this->withoutExceptionHandling();
        $this->post('leads', $this->Array());
        $this->assertDatabaseHas('leads', $this->Array);
    }
}
1

There are 1 answers

2
Adam Kozlowski On

That is the reason of your error:

$this->withoutExceptionHandling();

Try without it.

Look also at class name it should be: LeadTest, and the file should be named LeadTest.php