‪TYPO3CMS  10.4
ExtensionTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
19 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
20 
24 class ‪ExtensionTest extends UnitTestCase
25 {
32  {
33  return [
34  'empty string' => [
35  '',
36  4
37  ],
38  'existing category string' => [
39  'plugin',
40  3
41  ],
42  'not existing category string' => [
43  'foo',
44  4
45  ],
46  'string number 3' => [
47  '3',
48  3
49  ],
50  'integer 3' => [
51  3,
52  3
53  ],
54  'string number not in range -1' => [
55  '-1',
56  4
57  ],
58  'integer not in range -1' => [
59  -1,
60  4
61  ],
62  'string number not in range 11' => [
63  '11',
64  4
65  ],
66  'integer not in range 11' => [
67  11,
68  4
69  ],
70  'object' => [
71  new \stdClass(),
72  4
73  ],
74  'array' => [
75  [],
76  4
77  ],
78  ];
79  }
80 
87  public function ‪getCategoryIndexFromStringOrNumberReturnsIndex($input, $expected)
88  {
89  $extension = new ‪Extension();
90  self::assertEquals($expected, $extension->getCategoryIndexFromStringOrNumber($input));
91  }
92 }
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Domain\Model
Definition: DownloadQueueTest.php:16
‪TYPO3\CMS\Extensionmanager\Domain\Model\Extension
Definition: Extension.php:29
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Domain\Model\ExtensionTest
Definition: ExtensionTest.php:25
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Domain\Model\ExtensionTest\getCategoryIndexFromStringOrNumberReturnsIndex
‪getCategoryIndexFromStringOrNumberReturnsIndex($input, $expected)
Definition: ExtensionTest.php:87
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Domain\Model\ExtensionTest\getCategoryIndexFromStringOrNumberReturnsIndexDataProvider
‪array getCategoryIndexFromStringOrNumberReturnsIndexDataProvider()
Definition: ExtensionTest.php:31