Fix fatal error on TestCase::assertViewHas when response is a Json- or RedirectResponse
Merge pull request #3982 from alprs/fix/assertViewHas-fatal-error

Fix fatal error on TestCase::assertViewHas