Ejemplo n.º 1
0
 public function testGetUserDefinedFunctions()
 {
     $definedFunctionArrays = get_defined_functions();
     $userDefinedFunctions = $definedFunctionArrays['user'];
     $functions = ezcReflection::getUserDefinedFunctions();
     self::assertEquals(count($userDefinedFunctions), count($functions));
     self::assertContainsOnly('ezcReflectionFunction', $functions);
     foreach ($functions as $functionName => $function) {
         self::assertTrue($function->isUserDefined());
         self::assertEquals(strtolower($function->getName()), $functionName);
         self::assertContains(strtolower($function->getName()), $userDefinedFunctions);
         // strtolower used because of the following error:
         /*
             Failed asserting that
             Array
             (
                 [0] => __autoload
                 [1] => phpunit_util_errorhandler
                 [2] => _pear_call_destructors
                 [3] => m1
                 [4] => mmm
                 [5] => m2
                 [6] => m3
                 [7] => m4
             )
              contains <string:PHPUnit_Util_ErrorHandler>.
         */
     }
 }