Example #1
0
 /**
  * Get a function.
  *
  * @param   string  $name    Function name.
  * @return  \Hoa\Core\Consistency\Xcallable
  * @throws  \Hoa\Math\Exception\UnknownFunction
  */
 public function getFunction($name)
 {
     return $this->_context->getFunction($name);
 }
Example #2
0
 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);
 }