Esempio n. 1
0
 /**
  * @deprecated 
  * 
  * @test
  */
 public function shouldPopulateFromPostHttpRequest()
 {
     $action = new GetHttpRequestAction();
     $action->setHttpRequest(Request::create('http://request.uri', 'POST', ['foo' => 'fooVal']));
     $request = new GetHttpRequest();
     $action->execute($request);
     self::assertSame([], $request->query);
     self::assertSame(['foo' => 'fooVal'], $request->request);
     self::assertSame('POST', $request->method);
     self::assertSame('http://request.uri/', $request->uri);
     self::assertStringStartsWith('Symfony', $request->userAgent);
     self::assertSame('127.0.0.1', $request->clientIp);
 }
 /**
  * @test
  */
 public function shouldPopulateFromPostHttpRequest()
 {
     $action = new GetHttpRequestAction();
     $action->setHttpRequest(Request::create('http://request.uri', 'POST', array('foo' => 'fooVal')));
     $request = new GetRequestRequest();
     $action->execute($request);
     $this->assertSame(array(), $request->query);
     $this->assertSame(array('foo' => 'fooVal'), $request->request);
     $this->assertSame('POST', $request->method);
     $this->assertSame('http://request.uri/', $request->uri);
     $this->assertSame('Symfony/2.X', $request->userAgent);
     $this->assertSame('127.0.0.1', $request->clientIp);
 }