[BUGFIX] StorageRepository should ignore not found driver class
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Unit / Resource / Driver / DriverRegistryTest.php
index bcac4e0..34e39e2 100644 (file)
@@ -115,6 +115,32 @@ class DriverRegistryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->assertEquals($className, $this->fixture->getDriverClass($shortName));
        }
 
+       /**
+        * @test
+        */
+       public function driverExistsReturnsTrueForAllExistingDrivers() {
+               $className = $this->getMockClass('TYPO3\\CMS\\Core\\Resource\\Driver\\AbstractDriver');
+               $shortName = uniqid();
+               $GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['registeredDrivers'] = array(
+                       $shortName => array(
+                               'class' => $className
+                       )
+               );
+               $this->initializeFixture();
+               $this->assertTrue($this->fixture->driverExists($shortName));
+               $this->assertFalse($this->fixture->driverExists(uniqid()));
+       }
+
+       /**
+        * @test
+        */
+       public function driverExistsReturnsFalseIfDriverDoesNotExist() {
+               $GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['registeredDrivers'] = array(
+               );
+               $this->initializeFixture();
+               $this->assertFalse($this->fixture->driverExists(uniqid()));
+       }
+
 }
 
 ?>
\ No newline at end of file