Alex Alex - 1 year ago 91
PHP Question

Laravel 5.3 has the testing method onPage been removed?

I'm following through a video series on Laracasts to help me understand how to run tests in Laravel.

The test described is:

->type('some query', '#term')
->see('Search results for "some query"')

However Laravel complains that
is not a valid method. I've looked through the docs but can't seem to find a change which best describes what alternative method to use.

I tried to do:

->type('some query', '#term')
->see('Search results for "some query"');

But it seems that the behaviour of that is to redirect to
before the form submits, meaning the output message is not the same and the assertion fails.

Answer Source

You can use seePageIs method.

Source code

Assert that the current page matches a given URI.

You can see more tips at the docs.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download