Laravel 5.6. Call to undefined method visit

Published 1 week ago by andremac96

Hi

I'm trying to test for registration using laravel.

    $this->visit('/register')
    ->type('Andre', 'name')
    ->press('Register')
    ->seePageIs('/');

I get this error

  1. Tests\Feature\UserTest::testExample Error: Call to undefined method Tests\Feature\UserTest::visit()

Any adivce

I don;t want to user dusk by the way

jcphpdev

Use the integrated functions. See this link : https://laravel.com/docs/5.6/http-tests

rin4ik
rin4ik
1 week ago (178,120 XP)

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