-
-
Save mlively/761133 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class PhakeClass | |
{ | |
public function __call($method, $args) | |
{ | |
return '__call'; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'Phake.php'; | |
require_once 'PhakeClass.php'; | |
class PhakeClassTest extends PHPUnit_Framework_TestCase | |
{ | |
public function testMockingOfMagicCallMethod() | |
{ | |
$expected = 'magicCalled'; | |
$obj = Phake::Mock('PhakeClass'); | |
Phake::when($obj)->magicCall()->thenReturn($expected); | |
$value = $obj->magicCall(); | |
$this->assertEquals($expected, $value); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment