/** * Add a variable. * * @param string $name Variable name. * @param callable $callable Callable. * @return void */ public function addVariable($name, callable $callable) { return $this->_context->addVariable($name, $callable); }
public function case_context_returns_the_right_function_callable() { $this->given($name = 'foo', $value = 42, $callable = function () use($value) { return $value; }, $context = new CUT(), $context->addFunction($name, $callable))->when($result = $context->getFunction($name))->then->integer($result())->isEqualTo($value); }