Ajvanho's avatar
Level 14

Unit test is not execute

This unit test is does not recognize at all?

<?php

namespace Tests\Unit\Categories;

//use PHPUnit\Framework\TestCase;
use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;

class Categorytest extends TestCase
{
    
	use RefreshDatabase;

	/** @test */
    public function it_have_many_childrens()
    {
    	$category = factory('App\Category')->create();

    	$category->childrens()->save(
    		factory('App\Category')->create()
    	);

        $this->assertInstanceOf('App\Category', $category->childrens()->first());
    }
}
0 likes
2 replies
Ajvanho's avatar
Level 14

Tnx; Laravel test documentation is a little weird.

Please or to participate in this conversation.