zupaazhai's avatar

Test integration test with visit() got 405 "MothodNotAllowed"

Hi, everybody, I have issue about integration testing when use visit()

$response = $this->
        ->visit('/project/create')
        ->see('Create Project')
        ->press('Create Project')
        ->see('Project name is required');

for test some route in my project but I always got

"A request to [http://localhost:8000] failed. Received status code [405]."

"Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException"

in spite of, correct route name and request method. However, I change visit() to call(), it can get correct response for this route. I not sure what the cause of this trouble.

anyone can help me,

thanks.

0 likes
0 replies

Please or to participate in this conversation.