tests/TestCase.php
/**
     * Load migrations - to be used for feature tests.
     *
     * @return void
     */
Load migrations - to be used for feature tests.
@return void
Load migrations - to be used for feature tests . @return void
protected function loadMigrations(): void
    {
        $paths = [
            __DIR__.'/../migrations',
        ];
        foreach ($paths as $path) {
            $options = ['--path' => $path];
            $options['--realpath'] = true;
            $migrator = new MigrateProcessor($this, $options);
            $migrator->up();
        }
        if (!Schema::hasTable('users')) {
            Schema::create('users', static function (Blueprint $table) {
                $table->bigIncrements('id');
                $table->string('name');
                $table->string('email')->unique();
                $table->timestamp('email_verified_at')->nullable();
                $table->string('password');
                $table->rememberToken();
                $table->timestamps();
            });
        }
        $this->resetApplicationArtisanCommands($this->app);
    }
protected function loadMigrations ( ) : void { $ paths = [ __DIR__ . '/../migrations' , ] ; foreach ( $ paths as $ path ) { $ options = [ '--path' => $ path ] ; $ options [ '--realpath' ] = true ; $ migrator = new MigrateProcessor ( $ this , $ options ) ; $ migrator -> up ( ) ; } if ( ! Schema :: hasTable ( 'users' ) ) { Schema :: create ( 'users' , static function ( Blueprint $ table ) { $ table -> bigIncrements ( 'id' ) ; $ table -> string ( 'name' ) ; $ table -> string ( 'email' ) -> unique ( ) ; $ table -> timestamp ( 'email_verified_at' ) -> nullable ( ) ; $ table -> string ( 'password' ) ; $ table -> rememberToken ( ) ; $ table -> timestamps ( ) ; } ) ; } $ this -> resetApplicationArtisanCommands ( $ this -> app ) ; }
Load migrations - to be used for feature tests.
Load migrations - to be used for feature tests .
// Also manually create users table so relations will work.