nothingworksinc / ticketbeast

Back to the lesson videos:
https://course.testdrivenlaravel.com/lessons
552 stars 11 forks source link

Issue with assertQueryStringHas() #78

Open iadambrown opened 6 years ago

iadambrown commented 6 years ago

Just a heads up for anyone going through the last module, it seems there's an issue with the assertQueryStringHas assertion, due to a change to the assertHasQueryStringParameter method that it calls. Basically, assertHasQueryStringParameter now returns $this (i.e. the Laravel\Dusk\Browser object) instead of the $output array which contains the query string key/value pairs.

So having something like $browser->assertQueryStringHas('response_type', 'code') will cause a "Error: Cannot use object of type Laravel\Dusk\Browser as array" error when it gets to this part of the assertQueryStringHas method:

PHPUnit::assertEquals(
    $value, $output[$name],
    "Query string parameter [{$name}] had value [{$output[$name]}], but expected [{$value}]."
);

I've opened an issue here: https://github.com/laravel/dusk/issues/455.

Here's the commit that causes the issue: https://github.com/laravel/dusk/commit/fb67e61819fb9bd23c363c2b49aa861ec1d9c724

Cheers!