コード例 #1
0
ファイル: Arithmetic.php プロジェクト: dantleech/Math
 /**
  * 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);
 }