Hi,
I would like to test a method from an abstract class. In this class is there a abstract method with is static.
I use PHPUnit. With normal abstract methods it works:
<?php
abstract class AbstractClass
{
public function concreteMethod()
{
return $this->abstractMethod();
}
public abstract function abstractMethod();
}
class AbstractClassTest extends PHPUnit_Framework_TestCase
{
public function testConcreteMethod()
{
$stub = $this->getMockForAbstractClass('AbstractClass');
$stub->expects($this->any())
->method('abstractMethod')
->will($this->returnValue(TRUE));
$this->assertTrue($stub->concreteMethod());
}
}
?>
phpunit file.php works.
But if the abstractMethod is static it displays:
PHP Fatal error: Class Mock_AbstractClass_6332ae11 contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (AbstractClass::abstractMethod) in /usr/local/apache2/php5.3/lib/php/PHPUnit/Framework/TestCase.php(1135) : eval()'d code on line 33