[BUGFIX] Fix access to empty ObjectStorage with numeric key
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Tests / Unit / Persistence / ObjectStorageTest.php
index 90390c4..8019ba6 100644 (file)
@@ -102,6 +102,22 @@ class ObjectStorageTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->assertEquals($objectStorage->offsetExists($object2), FALSE);
        }
 
+       /**
+        * @test
+        */
+       public function offsetExistsWorksWithEmptyStorageAndIntegerKey() {
+               $objectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
+               $this->assertEquals($objectStorage->offsetExists(0), FALSE);
+       }
+
+       /**
+        * @test
+        */
+       public function offsetExistsWorksWithEmptyStorageAndStringKey() {
+               $objectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
+               $this->assertEquals($objectStorage->offsetExists('0'), FALSE);
+       }
+
        /**
         * @test
         */