Ticket #37 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

PHPUnit2Util::getDefinedClasses

Reported by: elias@adaptiveinstance.com Assigned to: mrook
Priority: trivial Milestone: 2.2.0
Component: Version: 2.2.0RC2
Keywords: Cc:

Description

PHPUnit2Util::getDefinedClasses issues a notice:

[PHP Error] Undefined index: ... [line 111 of /usr/share/pear/phing/tasks/ext/phpunit2/PHPUnit2Util.php]

Line 111 should be replaced with:

$declaredClasses = array_merge(get_declared_interfaces(), get_declared_classes());

Attachments

Change History

05/14/06 17:25:35 changed by mrook

  • owner set to mrook.
  • status changed from new to assigned.

I agree with your bugreport, but not with your proposed solution. The method getDefinedClasses() does not (and should not) care about interfaces.

A better solution (one which I would commit) would be:

if (is_array(self::$definedClasses[$filename]))
{
  return self::$definedClasses[$filename];
}
else
{
  return array();
}

05/14/06 17:26:58 changed by mrook

The "is_array" in the previous comment should obviously be "isset".

05/14/06 18:41:48 changed by elias

i din't thougt much about the context, i just wanted the error go away. :) your solution is fine too.

05/15/06 06:56:56 changed by mrook

  • status changed from assigned to closed.
  • resolution set to fixed.

Fixed in r68, thanks!


Add/Change #37 (PHPUnit2Util::getDefinedClasses)




Action