public function testCannotEvaluateUnknownOperator() { $node = new ExpressionNode(new RationalNode(1, 1), '+', new VariableNode('x')); // We need to cheat here, since the ExpressionNode contructor already // throws an UnknownOperatorException when called with, say '%' $node->setOperator('%'); $this->setExpectedException(UnknownOperatorException::class); $this->evaluate($node); }