コード例 #1
0
 protected function compileCode(&$code)
 {
     $code .= '(';
     $code .= sprintf($this->operator, $this->operand->compile());
     $code .= ')';
 }
コード例 #2
0
ファイル: ExpressionTest.php プロジェクト: aleczhang/phpspock
 /**
  * @test
  */
 public function thrownShouldBeConvertedIntoSomethingUseful_WithExceptionType4()
 {
     $exp = new Expression();
     $exp->setCode('notThrown("RuntimeException")');
     $code = $exp->compile();
     $__specification_Exception = null;
     /**
      * @var $__specification__expressionResult;
      */
     eval($code);
     $this->assertTrue($__specification__expressionResult);
     $__specification_Exception = new \Exception('foo');
     /**
      * @var $__specification__expressionResult;
      */
     eval($code);
     $this->assertTrue($__specification__expressionResult);
     $this->assertNotNull($__specification_Exception);
 }