예제 #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);
 }
예제 #2
0
파일: Context.php 프로젝트: mgratch/Math
 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);
 }