1 week ago

error unit test: Unable to locate factory

Posted 1 week ago by IvanRadojevic

I use this factory in feauture test and it is working. What is the problem in unit testing?

  1. Tests\Unit\ReplyTest::it_has_body InvalidArgumentException: Unable to locate factory for [App\Reply].

namespace Tests\Unit;

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

class ReplyTest extends TestCase

	use RefreshDatabase;

    /** @test */
    public function it_has_body()
        $reply = factory('App\Reply')->create();

        $this->assertInstanceOf('App\User', $reply->owner);

Please sign in or create an account to participate in this conversation.