‪TYPO3CMS  11.5
DataMapFactoryTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
26 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
27 
28 class ‪DataMapFactoryTest extends FunctionalTestCase
29 {
33  protected ‪$initializeDatabase = false;
34 
38  protected ‪$dataMapFactory;
39 
40  protected ‪$testExtensionsToLoad = ['typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example'];
41 
45  protected function ‪setUp(): void
46  {
47  parent::setUp();
48  $this->dataMapFactory = $this->get(DataMapFactory::class);
49  ‪$GLOBALS['BE_USER'] = new ‪BackendUserAuthentication();
50  }
51 
55  public function ‪classSettingsAreResolved(): void
56  {
57  $dataMap = $this->dataMapFactory->buildDataMap(Administrator::class);
58 
59  self::assertInstanceOf(DataMap::class, $dataMap);
60  self::assertEquals('ExtbaseTeam\BlogExample\Domain\Model\Administrator', $dataMap->getRecordType());
61  self::assertEquals('fe_users', $dataMap->getTableName());
62  }
63 
67  public function ‪columnMapPropertiesAreResolved(): void
68  {
69  $dataMap = $this->dataMapFactory->buildDataMap(TtContent::class);
70 
71  self::assertInstanceOf(DataMap::class, $dataMap);
72  self::assertNull($dataMap->getColumnMap('thisPropertyDoesNotExist'));
73 
74  $headerColumnMap = $dataMap->getColumnMap('header');
75 
76  self::assertInstanceOf(ColumnMap::class, $headerColumnMap);
77  self::assertEquals('header', $headerColumnMap->getPropertyName());
78  self::assertEquals('header', $headerColumnMap->getColumnName());
79  }
80 }
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapFactoryTest\$testExtensionsToLoad
‪$testExtensionsToLoad
Definition: DataMapFactoryTest.php:38
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMap
Definition: DataMap.php:23
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapFactoryTest\setUp
‪setUp()
Definition: DataMapFactoryTest.php:43
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapFactoryTest\classSettingsAreResolved
‪classSettingsAreResolved()
Definition: DataMapFactoryTest.php:53
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapFactoryTest\$initializeDatabase
‪bool $initializeDatabase
Definition: DataMapFactoryTest.php:32
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapFactoryTest\$dataMapFactory
‪DataMapFactory $dataMapFactory
Definition: DataMapFactoryTest.php:36
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap
Definition: ColumnMap.php:28
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper
Definition: DataMapFactoryTest.php:18
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory
Definition: DataMapFactory.php:39
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapFactoryTest\columnMapPropertiesAreResolved
‪columnMapPropertiesAreResolved()
Definition: DataMapFactoryTest.php:65
‪ExtbaseTeam\BlogExample\Domain\Model\Administrator
Definition: Administrator.php:28
‪ExtbaseTeam\BlogExample\Domain\Model\TtContent
Definition: TtContent.php:28
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:62
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Mapper\DataMapFactoryTest
Definition: DataMapFactoryTest.php:29