Support the ongoing development of →
Laravel Testing
Last updated 2 years ago.

Hi. This worked for me:

namespace Modules\Administration\Tests\Entities\ArrayRepository;

use Tests\TestCase;
use Illuminate\Container\Container;

class UserEntityTest extends TestCase
    public function setUp()
        $app = Container::getInstance();

    public function test_create_User_Entity()
         * Thing to do in order to resolve this Entity from Array Repository
         * 1. Make an interface Modules\Administration\Entities\User
         * 2. Make an implementation Modules\Administration\Repositories\ArrayRepository\User
         * 3. Bind the implementation to the interface
        $user = resolve('Modules\Administration\Entities\User');
        $this->assertNotNull($user, 'Can not create Administration\Entities\User');

Good luck!


Sign in to participate in this thread!


Your banner here too?

shinijaQB shinijaqb Joined 1 Oct 2015


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.