‪TYPO3CMS  11.5
MetaDataTest.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 
21 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
22 
23 class ‪MetaDataTest extends UnitTestCase
24 {
25  public function ‪typeIsCorrectlyResolvedDataProvider(): \Generator
26  {
27  yield 'framework type is set' => [
28  'typo3-cms-framework',
29  true,
30  true,
31  ];
32 
33  yield 'extension type is set' => [
34  'typo3-cms-extension',
35  true,
36  false,
37  ];
38 
39  yield 'no type is set' => [
40  null,
41  false,
42  false,
43  ];
44 
45  yield 'other type is set' => [
46  'other',
47  false,
48  false,
49  ];
50  }
51 
59  public function ‪typeIsCorrectlyResolved(?string $type, bool $isExtension, bool $isFramework): void
60  {
61  $metaData = new ‪MetaData('foo');
62  $metaData->setPackageType($type);
63  self::assertSame($isExtension, $metaData->isExtensionType());
64  self::assertSame($isFramework, $metaData->isFrameworkType());
65  }
66 }
‪TYPO3\CMS\Core\Tests\Unit\Package\MetaDataTest
Definition: MetaDataTest.php:24
‪TYPO3\CMS\Core\Tests\Unit\Package\MetaDataTest\typeIsCorrectlyResolved
‪typeIsCorrectlyResolved(?string $type, bool $isExtension, bool $isFramework)
Definition: MetaDataTest.php:59
‪TYPO3\CMS\Core\Tests\Unit\Package
Definition: AbstractServiceProviderTest.php:18
‪TYPO3\CMS\Core\Package\MetaData
Definition: PackageConstraint.php:16
‪TYPO3\CMS\Core\Tests\Unit\Package\MetaDataTest\typeIsCorrectlyResolvedDataProvider
‪typeIsCorrectlyResolvedDataProvider()
Definition: MetaDataTest.php:25
‪TYPO3\CMS\Core\Package\MetaData
Definition: MetaData.php:24