Created
August 17, 2016 11:18
-
-
Save s7anley/310520115bda3dc825307b94bf2dd954 to your computer and use it in GitHub Desktop.
withCallback
This file contains hidden or 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 | |
/** | |
* @dataProvider expressionsProvider | |
*/ | |
public function testEvaluateReceiveCorrectExpression(Expression $expectedExpression) | |
{ | |
$evaluator = $this->getMock(Evaluator::class); | |
$evaluator->expects($this->once()) | |
->method('evaluate') | |
->with( | |
$this->callback( | |
function ($expression) use ($expectedExpression) { | |
// Has to return boolean | |
return ($expression->getType() === $expectedExpression->getType()); | |
} | |
) | |
); | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment