From a706f7c801ec5433085b08983aee4bab9ca1f9c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 12 Oct 2016 18:23:15 +0200 Subject: [PATCH] Test invalid chars in expression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- src/Expression.php | 2 +- tests/CalculateTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Expression.php b/src/Expression.php index e5b1bc7..a3162a1 100644 --- a/src/Expression.php +++ b/src/Expression.php @@ -84,7 +84,7 @@ public static function factory($value) { return new Expressions\OperatorAnd($value); } - throw new \Exception('Undefined Value ' . $value); + throw new \RuntimeException('Undefined Value ' . $value); } abstract public function operate(Stack $stack, $variables=array()); diff --git a/tests/CalculateTest.php b/tests/CalculateTest.php index 0c122c6..6f1b298 100644 --- a/tests/CalculateTest.php +++ b/tests/CalculateTest.php @@ -183,6 +183,7 @@ public function errorEquations() array('1 + (1 : 2)'), array('(1 + 2'), array('1 + 2)'), + array('#'), ); } }