Просмотр исходного кода

ZF-8424: fixed warnings with class_exists calls, added test

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@19310 44c647ce-9c0f-0410-b52a-842ac1e357ba
bate 16 лет назад
Родитель
Сommit
6e58e87afe

+ 1 - 1
library/Zend/Application/Bootstrap/BootstrapAbstract.php

@@ -351,7 +351,7 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
                 }
             }
 
-            if (class_exists($plugin)) {
+            if (class_exists($plugin, false)) {
                 $spec = (array) $spec;
                 $spec['bootstrap'] = $this;
                 $instance = new $plugin($spec);

+ 13 - 0
tests/Zend/Application/Bootstrap/BootstrapAbstractTest.php

@@ -719,6 +719,19 @@ class Zend_Application_Bootstrap_BootstrapAbstractTest extends PHPUnit_Framework
         $actual   = $bootstrap->getOptionKeys();
         $this->assertEquals($expected, $actual);
     }
+
+    /**
+     * @group ZF-8424
+     */
+    public function testCallBootstrapHasResourcePluginCausesWarning()
+    {
+        $this->autoloader
+             ->suppressNotFoundWarnings(false)
+             ->setFallbackAutoloader(true);
+        $bootstrap = new Zend_Application_Bootstrap_Bootstrap($this->application);
+        // this should fail with warnings
+        $bootstrap->hasPluginResource('foo');
+    }
 }
 
 class Zend_Application_Bootstrap_BootstrapAbstractTest_View