‪TYPO3CMS  9.5
FormSelectTreeAjaxControllerTest.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
17 use Psr\Http\Message\ServerRequestInterface;
19 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
20 
24 class ‪FormSelectTreeAjaxControllerTest extends UnitTestCase
25 {
30  {
31  $requestProphecy = $this->prophesize(ServerRequestInterface::class);
32  $this->expectException(\RuntimeException::class);
33  $this->expectExceptionCode(1479386729);
34  (new ‪FormSelectTreeAjaxController())->fetchDataAction($requestProphecy->reveal());
35  }
36 
41  {
42  $requestProphecy = $this->prophesize(ServerRequestInterface::class);
43  $requestProphecy->getQueryParams()->shouldBeCalled()->willReturn([
44  'tableName' => 'aTable',
45  'fieldName' => 'aField',
46  ]);
47  ‪$GLOBALS['TCA']['aTable']['columns'] = [];
48  $this->expectException(\RuntimeException::class);
49  $this->expectExceptionCode(1479386990);
50  (new ‪FormSelectTreeAjaxController())->fetchDataAction($requestProphecy->reveal());
51  }
52 }
‪TYPO3\CMS\Backend\Controller\FormSelectTreeAjaxController
Definition: FormSelectTreeAjaxController.php:29
‪TYPO3\CMS\Backend\Tests\Unit\Controller\FormSelectTreeAjaxControllerTest\fetchDataActionThrowsExceptionIfTcaOfTableDoesNotExist
‪fetchDataActionThrowsExceptionIfTcaOfTableDoesNotExist()
Definition: FormSelectTreeAjaxControllerTest.php:29
‪TYPO3\CMS\Backend\Tests\Unit\Controller\FormSelectTreeAjaxControllerTest
Definition: FormSelectTreeAjaxControllerTest.php:25
‪TYPO3\CMS\Backend\Tests\Unit\Controller
Definition: EditDocumentControllerTest.php:3
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Backend\Tests\Unit\Controller\FormSelectTreeAjaxControllerTest\fetchDataActionThrowsExceptionIfTcaOfTableFieldDoesNotExist
‪fetchDataActionThrowsExceptionIfTcaOfTableFieldDoesNotExist()
Definition: FormSelectTreeAjaxControllerTest.php:40