You are here

public function RequestTest::testIsXmlHttpRequest in Zircon Profile 8

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

File

vendor/symfony/http-foundation/Tests/RequestTest.php, line 1251

Class

RequestTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testIsXmlHttpRequest() {
  $request = new Request();
  $this
    ->assertFalse($request
    ->isXmlHttpRequest());
  $request->headers
    ->set('X-Requested-With', 'XMLHttpRequest');
  $this
    ->assertTrue($request
    ->isXmlHttpRequest());
  $request->headers
    ->remove('X-Requested-With');
  $this
    ->assertFalse($request
    ->isXmlHttpRequest());
}