protected function compileCode(&$code) { $code .= '('; $code .= sprintf($this->operator, $this->operand->compile()); $code .= ')'; }
/** * @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); }