Fix fatal error on TestCase::assertViewHas when response is a Json- or RedirectResponse