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