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