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