]> git.immae.eu Git - github/wallabag/wallabag.git/blob - vendor/symfony/form/Symfony/Component/Form/Tests/Extension/HttpFoundation/HttpFoundationRequestHandlerTest.php
gitignore vendor
[github/wallabag/wallabag.git] / vendor / symfony / form / Symfony / Component / Form / Tests / Extension / HttpFoundation / HttpFoundationRequestHandlerTest.php
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\Form\Tests\Extension\HttpFoundation;
13
14 use Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationRequestHandler;
15 use Symfony\Component\Form\Tests\AbstractRequestHandlerTest;
16 use Symfony\Component\HttpFoundation\Request;
17
18 /**
19 * @author Bernhard Schussek <bschussek@gmail.com>
20 */
21 class HttpFoundationRequestHandlerTest extends AbstractRequestHandlerTest
22 {
23 /**
24 * @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException
25 */
26 public function testRequestShouldNotBeNull()
27 {
28 $this->requestHandler->handleRequest($this->getMockForm('name', 'GET'));
29 }
30 /**
31 * @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException
32 */
33 public function testRequestShouldBeInstanceOfRequest()
34 {
35 $this->requestHandler->handleRequest($this->getMockForm('name', 'GET'), new \stdClass());
36 }
37
38 protected function setRequestData($method, $data, $files = array())
39 {
40 $this->request = Request::create('http://localhost', $method, $data, array(), $files);
41 }
42
43 protected function getRequestHandler()
44 {
45 return new HttpFoundationRequestHandler();
46 }
47
48 protected function getMockFile()
49 {
50 return $this->getMockBuilder('Symfony\Component\HttpFoundation\File\UploadedFile')
51 ->disableOriginalConstructor()
52 ->getMock();
53 }
54 }