public function testRedirectSkipsWhitelistedDomains($whitelist, $domain, $pass) { $listener = new ExternalRedirectListener(true, null, null, $whitelist); if (!$pass) { $this->setExpectedException('Symfony\\Component\\HttpKernel\\Exception\\HttpException'); } $response = $this->filterResponse($listener, 'http://foo.com/', 'http://' . $domain . '/'); $this->assertSame($pass, $response->isRedirect()); }