We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
e.g.
class MagicMethodTest { /** * @param string $methodName * @param array $argument * * @return string */ public function __call($methodName, array $argument) { return $methodName; } } class MagicMethodUsage { /** * @param \Box\PHPUnitTestGenerator\tests\_fixture\_input\MagicMethodTest $magicTest * * @return string */ public function callMagicMethod( MagicMethodTest $magicTest ) { $rc = $magicTest->foo(); return $rc; } } <?php class MagicMethodUsageGenTest extends \PHPUnit_Framework_TestCase { use \Shmock\Shmockers; public function testCallMagicMethod() { // Setup mocks for parameters to the method under test. $mockMagicMethodTest0 = $this->shmock( 'MagicMethodTest', function ( $shmock ) { // $shmock->dont_preserve_original_methods(); /** @var $mock \Shmock\Spec */ $mock = $shmock->__call('foo', array ( )); $mock->return_value('bar'); } ); // Execute the method under test. $objectUnderTest = new MagicMethodUsage(); $executionResult = $objectUnderTest->callMagicMethod($mockMagicMethodTest0); // Validate the execution result. $expected = 'bar'; $this->assertSame( $expected, $executionResult, 'Variable ( executionResult ) doesn\'t have the expected value.' ); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
e.g.
The text was updated successfully, but these errors were encountered: