Nestable\Tests\DBTestCase::setUp PHP Method

setUp() public method

* Bootstrap the application
public setUp ( )
    public function setUp()
    {
        parent::setUp();
        $this->artisan = $this->app->make('Illuminate\\Contracts\\Console\\Kernel');
        $this->artisan('migrate', ['--database' => 'testbench', '--realpath' => realpath(__DIR__ . '/migrations')]);
    }

Usage Example

 /**
  * Setup the test environment.
  */
 public function setUp()
 {
     parent::setUp();
     $this->withFactories(__DIR__ . '/factories');
     factory(Model\Category::class, 50)->create();
     $this->categories = Model\Category::all()->toArray();
 }