You are here

public function RequestMatcherTest::testHost in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/RequestMatcherTest.php \Symfony\Component\HttpFoundation\Tests\RequestMatcherTest::testHost()

@dataProvider testHostFixture

File

vendor/symfony/http-foundation/Tests/RequestMatcherTest.php, line 68

Class

RequestMatcherTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testHost($pattern, $isMatch) {
  $matcher = new RequestMatcher();
  $request = Request::create('', 'get', array(), array(), array(), array(
    'HTTP_HOST' => 'foo.example.com',
  ));
  $matcher
    ->matchHost($pattern);
  $this
    ->assertSame($isMatch, $matcher
    ->matches($request));
  $matcher = new RequestMatcher(null, $pattern);
  $this
    ->assertSame($isMatch, $matcher
    ->matches($request));
}