public function ClientTest::testGetScript

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/ClientTest.php, line 51

Class

ClientTest

Namespace

Symfony\Component\HttpKernel\Tests

Code

public function testGetScript() {
  if (!class_exists('Symfony\\Component\\Process\\Process')) {
    $this
      ->markTestSkipped('The "Process" component is not available');
  }
  if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader')) {
    $this
      ->markTestSkipped('The "ClassLoader" component is not available');
  }
  $client = new TestClient(new TestHttpKernel());
  $client
    ->insulate();
  $client
    ->request('GET', '/');
  $this
    ->assertEquals('Request: /', $client
    ->getResponse()
    ->getContent(), '->getScript() returns a script that uses the request handler to make the request');
}