[CLEANUP] Rework/simplify copyright header and remove @package
[Packages/TYPO3.CMS.git] / typo3 / sysext / fluid / Tests / Unit / Core / Widget / WidgetRequestHandlerTest.php
1 <?php
2 namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Widget;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is backported from the TYPO3 Flow package "TYPO3.Fluid".
8 *
9 * It is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License, either version 2
11 * of the License, or any later version.
12 *
13 * For the full copyright and license information, please read the
14 * LICENSE.txt file that was distributed with this source code.
15 *
16 * The TYPO3 project - inspiring people to share!
17 */
18
19 /**
20 * Test case
21 */
22 class WidgetRequestHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
23
24 /**
25 * @var \TYPO3\CMS\Fluid\Core\Widget\WidgetRequestHandler
26 */
27 protected $widgetRequestHandler;
28
29 /**
30 * Set up
31 */
32 public function setUp() {
33 $this->widgetRequestHandler = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequestHandler', array('dummy'), array(), '', FALSE);
34 }
35
36 /**
37 * @test
38 */
39 public function canHandleRequestReturnsTrueIfCorrectGetParameterIsSet() {
40 $_GET['fluid-widget-id'] = 123;
41 $this->assertTrue($this->widgetRequestHandler->canHandleRequest());
42 }
43
44 /**
45 * @test
46 */
47 public function canHandleRequestReturnsFalsefGetParameterIsNotSet() {
48 $_GET['some-other-id'] = 123;
49 $this->assertFalse($this->widgetRequestHandler->canHandleRequest());
50 }
51
52 /**
53 * @test
54 */
55 public function priorityIsHigherThanDefaultRequestHandler() {
56 $defaultWebRequestHandler = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\AbstractRequestHandler', array('handleRequest'), array(), '', FALSE);
57 $this->assertTrue($this->widgetRequestHandler->getPriority() > $defaultWebRequestHandler->getPriority());
58 }
59 }