‪TYPO3CMS  ‪main
JavaScriptModuleInstructionTest.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 
20 use PHPUnit\Framework\Attributes\DataProvider;
21 use PHPUnit\Framework\Attributes\Test;
23 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
24 
25 final class ‪JavaScriptModuleInstructionTest extends UnitTestCase
26 {
27  public static function ‪flagsAreAssignedDataProvider(): array
28  {
29  return [
30  [0, 0, 0],
31  [8, 8, 8, 8, 8],
32  [12, 8, 4, 4],
33  [7, 1, 7, 1, 2, 4],
34  [7, 7, 7, 1, 2, 4],
35  ];
36  }
37 
38  #[DataProvider('flagsAreAssignedDataProvider')]
39  #[Test]
40  public function ‪flagsAreAssigned(int $expectation, int $flags, int ...$additionalFlags): void
41  {
42  $subject = new ‪JavaScriptModuleInstruction('Test', $flags);
43  $subject->addFlags(...$additionalFlags);
44  self::assertSame($expectation, $subject->getFlags());
45  }
46 }
‪TYPO3\CMS\Core\Tests\Unit\Page
Definition: AssetCollectorTest.php:18
‪TYPO3\CMS\Core\Tests\Unit\Page\JavaScriptModuleInstructionTest\flagsAreAssigned
‪flagsAreAssigned(int $expectation, int $flags, int ... $additionalFlags)
Definition: JavaScriptModuleInstructionTest.php:40
‪TYPO3\CMS\Core\Tests\Unit\Page\JavaScriptModuleInstructionTest
Definition: JavaScriptModuleInstructionTest.php:26
‪TYPO3\CMS\Core\Page\JavaScriptModuleInstruction
Definition: JavaScriptModuleInstruction.php:23
‪TYPO3\CMS\Core\Tests\Unit\Page\JavaScriptModuleInstructionTest\flagsAreAssignedDataProvider
‪static flagsAreAssignedDataProvider()
Definition: JavaScriptModuleInstructionTest.php:27