You are here

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

File

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

Class

RequestTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testGetContentReturnsResourceWhenContentSetInConstructor() {
  $req = new Request(array(), array(), array(), array(), array(), array(), 'MyContent');
  $resource = $req
    ->getContent(true);
  $this
    ->assertTrue(is_resource($resource));
  $this
    ->assertEquals('MyContent', stream_get_contents($resource));
}