4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Form\Tests\Extension\HttpFoundation
;
14 use Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationRequestHandler
;
15 use Symfony\Component\Form\Tests\AbstractRequestHandlerTest
;
16 use Symfony\Component\HttpFoundation\Request
;
19 * @author Bernhard Schussek <bschussek@gmail.com>
21 class HttpFoundationRequestHandlerTest
extends AbstractRequestHandlerTest
24 * @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException
26 public function testRequestShouldNotBeNull()
28 $this->requestHandler
->handleRequest($this->getMockForm('name', 'GET'));
31 * @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException
33 public function testRequestShouldBeInstanceOfRequest()
35 $this->requestHandler
->handleRequest($this->getMockForm('name', 'GET'), new \
stdClass());
38 protected function setRequestData($method, $data, $files = array())
40 $this->request
= Request
::create('http://localhost', $method, $data, array(), $files);
43 protected function getRequestHandler()
45 return new HttpFoundationRequestHandler();
48 protected function getMockFile()
50 return $this->getMockBuilder('Symfony\Component\HttpFoundation\File\UploadedFile')
51 ->disableOriginalConstructor()