Last active
February 4, 2016 09:00
-
-
Save mwr/843e0a86becbb5412dc5 to your computer and use it in GitHub Desktop.
PHPUnit Parameter Validation using Callback (phpunit 4.1.0)
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 | |
// Validation Callback | |
$validator1 = new \PHPUnit_Framework_Constraint_Callback( | |
function (/** @todo add parameter **/) { | |
// @todo add assertions here | |
return true; | |
} | |
); | |
$validator2 = new \PHPUnit_Framework_Constraint_Callback( | |
function (/** @todo add parameter **/) { | |
// @todo add assertions here | |
return true; | |
} | |
); | |
// | |
$this->mock->expects($this->once())->method('$METHODNAME')->with($validator1, $validator2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment