Kaynağa Gözat

Zend_Application_Resource_ModulesTest minor fixes.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@15758 44c647ce-9c0f-0410-b52a-842ac1e357ba
alexander 16 yıl önce
ebeveyn
işleme
956ff057d2

+ 9 - 7
tests/Zend/Application/Resource/ModulesTest.php

@@ -54,7 +54,7 @@ class Zend_Application_Resource_ModulesTest extends PHPUnit_Framework_TestCase
         // Store original autoloaders
         // Store original autoloaders
         $this->loaders = spl_autoload_functions();
         $this->loaders = spl_autoload_functions();
         if (!is_array($this->loaders)) {
         if (!is_array($this->loaders)) {
-            // spl_autoload_functions does not return empty array when no 
+            // spl_autoload_functions does not return empty array when no
             // autoloaders registered...
             // autoloaders registered...
             $this->loaders = array();
             $this->loaders = array();
         }
         }
@@ -135,9 +135,10 @@ class Zend_Application_Resource_ModulesTest extends PHPUnit_Framework_TestCase
         $resource->setBootstrap($this->bootstrap);
         $resource->setBootstrap($this->bootstrap);
         $resource->init();
         $resource->init();
         $bootstraps = $resource->getExecutedBootstraps();
         $bootstraps = $resource->getExecutedBootstraps();
-        $test       = array_keys((array) $bootstraps);
-        $expected   = array('bar', 'foo-bar', 'foo');
-        $this->assertEquals($expected, $test);
+        $this->assertEquals(3, count((array)$bootstraps));
+        $this->assertArrayHasKey('bar',     (array)$bootstraps);
+        $this->assertArrayHasKey('foo-bar', (array)$bootstraps);
+        $this->assertArrayHasKey('foo',     (array)$bootstraps);
     }
     }
 
 
     public function testShouldReturnExecutedBootstrapsWhenComplete()
     public function testShouldReturnExecutedBootstrapsWhenComplete()
@@ -150,9 +151,10 @@ class Zend_Application_Resource_ModulesTest extends PHPUnit_Framework_TestCase
         $resource = new Zend_Application_Resource_Modules(array());
         $resource = new Zend_Application_Resource_Modules(array());
         $resource->setBootstrap($this->bootstrap);
         $resource->setBootstrap($this->bootstrap);
         $bootstraps = $resource->init();
         $bootstraps = $resource->init();
-        $test       = array_keys((array) $bootstraps);
-        $expected   = array('bar', 'foo-bar', 'foo');
-        $this->assertEquals($expected, $test);
+        $this->assertEquals(3, count((array)$bootstraps));
+        $this->assertArrayHasKey('bar',     (array)$bootstraps);
+        $this->assertArrayHasKey('foo-bar', (array)$bootstraps);
+        $this->assertArrayHasKey('foo',     (array)$bootstraps);
     }
     }
 }
 }