You are here

public function RequestTest::testGetContentCanBeCalledTwiceWithResources 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::testGetContentCanBeCalledTwiceWithResources()

@dataProvider getContentCantBeCalledTwiceWithResourcesProvider

File

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

Class

RequestTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testGetContentCanBeCalledTwiceWithResources($first, $second) {
  if (PHP_VERSION_ID < 50600) {
    $this
      ->markTestSkipped('PHP < 5.6 does not allow to open php://input several times.');
  }
  $req = new Request();
  $a = $req
    ->getContent($first);
  $b = $req
    ->getContent($second);
  if ($first) {
    $a = stream_get_contents($a);
  }
  if ($second) {
    $b = stream_get_contents($b);
  }
  $this
    ->assertEquals($a, $b);
}