[BUGFIX] Follow-up: Fix broken test in CategoryRegistryTest 60/24860/5
authorMarc Bastian Heinrichs <typo3@mbh-software.de>
Thu, 17 Oct 2013 09:12:37 +0000 (11:12 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Thu, 17 Oct 2013 10:01:25 +0000 (12:01 +0200)
Since I156528669704004a86243e03f34d3a1af07cdb21 CategoryRegistryTest
is broken, because argument $options of CategoryRegistry::add
is a required array now. But the method throws an exception
if the argument type doesn't match.

Keep argument typing and remove invalid argument exception
(and corresponding unit test).

Resolves: #52910
Related: #52285
Releases: 6.2
Change-Id: If7d8e51f8fcc0cd9bf579186d768c835837787ef
Reviewed-on: https://review.typo3.org/24860
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/sysext/core/Classes/Category/CategoryRegistry.php
typo3/sysext/core/Tests/Unit/Category/CategoryRegistryTest.php

index fd1b4c5..3ca3f34 100644 (file)
@@ -88,10 +88,6 @@ class CategoryRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                        throw new \InvalidArgumentException('TYPO3\\CMS\\Core\\Category\\CategoryRegistry No tableName given.', 1369122038);
                }
 
-               if (!is_array($options)) {
-                       throw new \InvalidArgumentException('TYPO3\\CMS\\Core\\Category\\CategoryRegistry options parameter must be an array', 1378976970);
-               }
-
                // Makes sure there is an existing table configuration and nothing registered yet:
                if (isset($GLOBALS['TCA'][$tableName]) && !$this->isRegistered($tableName, $fieldName)) {
                        $this->registry[$extensionKey][$tableName][$fieldName] = $options;
index 8a2901a..e4017d7 100644 (file)
@@ -95,15 +95,6 @@ class CategoryRegistryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
-        * @expectedException \InvalidArgumentException
-        * @expectedExceptionCode 1378976970
-        */
-       public function doesAddThrowExceptionIfOptionsIsNotAnArray() {
-               $this->fixture->add('test_extension_a', $this->tables['first'], 'categories', 'not_an_array');
-       }
-
-       /**
-        * @test
         */
        public function areMultipleElementsOfSameExtensionRegistered() {
                $this->fixture->add('test_extension_a', $this->tables['first'], 'categories');