‪TYPO3CMS  10.4
FileConverterTest.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 
23 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
24 
25 class ‪FileConverterTest extends FunctionalTestCase
26 {
30  public function ‪convertReturnsFileObject()
31  {
32  ‪$GLOBALS['BE_USER'] = new ‪BackendUserAuthentication();
33  ‪$GLOBALS['BE_USER']->user = ['admin' => true];
34 
35  $this->importDataSet(__DIR__ . '/../Fixtures/DatabaseImports/sys_file.xml');
36  $this->importDataSet(__DIR__ . '/../Fixtures/DatabaseImports/sys_file_storage.xml');
37 
38  $propertyMapper = $this->getContainer()->get(PropertyMapper::class);
39 
41  $file = $propertyMapper->convert(
42  1,
43  File::class
44  );
45 
46  self::assertInstanceOf(File::class, $file);
47  self::assertSame(1, $file->getOriginalResource()->getUid());
48  }
49 }
‪TYPO3\CMS\Extbase\Domain\Model\File
Definition: File.php:27
‪TYPO3\CMS\Extbase\Tests\Functional\Property\TypeConverter\FileConverterTest
Definition: FileConverterTest.php:26
‪TYPO3\CMS\Extbase\Tests\Functional\Property\TypeConverter
Definition: ArrayConverterTest.php:18
‪TYPO3\CMS\Extbase\Tests\Functional\Property\TypeConverter\FileConverterTest\convertReturnsFileObject
‪convertReturnsFileObject()
Definition: FileConverterTest.php:30
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:62
‪TYPO3\CMS\Extbase\Property\PropertyMapper
Definition: PropertyMapper.php:37
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5