[TASK] Removes eval() in core tree dataprovider unit test
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Unit / Tree / TableConfiguration / Fixtures / TreeDataProviderWithConfigurationFixture.php
1 <?php
2 namespace TYPO3\CMS\Core\Tests\Unit\Tree\TableConfiguration\Fixtures;
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 /**
18 * Fixture configured data provider
19 */
20 class TreeDataProviderWithConfigurationFixture {
21
22 /**
23 * @param array $configuration
24 * @throws \Exception
25 */
26 public function __construct($configuration) {
27 if (!is_array($configuration)) {
28 throw new \Exception('Failed asserting that the constructor arguments are an array', 1438875247);
29 }
30 $tcaConfiguration = [
31 'treeConfig' => [
32 'dataProvider' => TreeDataProviderWithConfigurationFixture::class,
33 ],
34 'internal_type' => 'foo',
35 ];
36 if ($configuration !== $tcaConfiguration) {
37 throw new \Exception('Failed asserting that the constructor arguments are correctly passed', 1438875248);
38 }
39 throw new \RuntimeException('This must be thrown', 1438875249);
40 }
41
42 }