2 declare(strict_types = 1);
21 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
33 protected function setUp(): void
39 $GLOBALS[
'TCA'][
'foo'][
'ctrl'][
'label'] =
'labelFoo';
49 'Empty Configuration' => [[], 1288215890],
50 'File Configuration' => [
52 'internal_type' =>
'file',
59 'internal_type' =>
'foo',
64 'No foreign table' => [
66 'internal_type' =>
'db',
71 'No tree configuration' => [
73 'internal_type' =>
'db',
74 'foreign_table' =>
'foo',
78 'Tree configuration not array' => [
80 'internal_type' =>
'db',
81 'foreign_table' =>
'foo',
82 'treeConfig' =>
'bar',
86 'Tree configuration missing childer and parent field' => [
88 'internal_type' =>
'db',
89 'foreign_table' =>
'foo',
105 $this->expectException(\InvalidArgumentException::class);
106 $this->expectExceptionCode($expectedExceptionCode);
108 $this->subject::getDataProvider($tcaConfiguration,
'foo',
'bar', [
'uid' => 1]);
116 $dataProviderMockClassName = TreeDataProviderFixture::class;
118 $tcaConfiguration = [
119 'treeConfig' => [
'dataProvider' => $dataProviderMockClassName],
120 'internal_type' =>
'foo'
122 $dataProvider = $this->subject::getDataProvider($tcaConfiguration,
'foo',
'bar', [
'uid' => 1]);
124 $this->assertInstanceOf($dataProviderMockClassName, $dataProvider);
132 $dataProviderMockClassName = TreeDataProviderWithConfigurationFixture::class;
134 $tcaConfiguration = [
136 'dataProvider' => $dataProviderMockClassName,
138 'internal_type' =>
'foo',
140 $this->expectException(\RuntimeException::class);
141 $this->expectExceptionCode(1438875249);
142 $this->subject::getDataProvider($tcaConfiguration,
'foo',
'bar', [
'uid' => 1]);