use PHPUnit\Framework\TestCase;
abstract class Greeting
{
public function hello($name)
{
return 'Hello '.$name;
}
}
class GreetingTest extends TestCase
{
public function testSayHello()
{
$greeting = $this->getMockForAbstractClass(Greeting::class);
$this->assertEquals('Hello Lucas', $greeting->hello('Lucas'));
}
}
Created
March 14, 2017 02:02
-
-
Save flyingluscas/d55c37d5ff59751e73c9a88f14f619c6 to your computer and use it in GitHub Desktop.
PHPUnit: Mock abstract class
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment