コード例 #1
0
 public function testImmutabilityIsMaintainedWhenInstantiated()
 {
     $request = new Request($symfonyRequest = new SymfonyRequest());
     $symfonyRequest->headers->add(array('X-mutable' => 'true'));
     $header = $request->getHeader('X-mutable');
     $this->assertEquals($header, null);
 }
コード例 #2
0
<?php

require __DIR__ . '/../../vendor/autoload.php';
use Silex\Application;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
use SamBurns\Psr7Symfony\Request;
$app = new Silex\Application();
$app->get('/what-was-the-user-agent/', function (SymfonyRequest $request) {
    $adaptedRequest = new Request($request);
    return serialize($adaptedRequest->getHeader('User-Agent'));
});
$app->run();
コード例 #3
0
 /**
  * @When I check the URI
  */
 public function iCheckTheUri()
 {
     $requestAdapter = new Request($this->symfonyRequest);
     $this->result = (string) $requestAdapter->getUri();
 }