Posted 4 months ago by PxlFxr

Hi, guys. I found similar question

But that seems not working for me.

There my code

use DatabaseMigrations;

  public function testRegister()

        $user = factory(\App\User::class)->make();

        $this->browse(function (Browser $browser) use ($user) {

            $pswd = str_random(10);

                    ->resize(1920, 1080)
                    ->type('name', $user->name)
                    ->type('email', $user->email)
                    ->type('password', $pswd)
                    ->type('password_confirmation', $pswd)
                    ->assertSeeIn('.personal__link .label', 'ЛК');

        $this->assertDatabaseHas('user', ['email'=>$user->email]);

After this executed, i see this

Caused by
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'craft_test.user' doesn't exist

How can i make assertDatabaseHas? Seems to be, migration rollback in test data base is done after $browse

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

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up


Reply to

Use Markdown with GitHub-flavored code blocks.