From 8f3e96ff24b4c47c11170d93db593214c42dbd14 Mon Sep 17 00:00:00 2001 From: Dariusz Ruminski Date: Sat, 6 Oct 2018 10:21:33 +0200 Subject: [PATCH] Make ExceptionMessage strict --- src/Framework/Constraint/ExceptionMessage.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Framework/Constraint/ExceptionMessage.php b/src/Framework/Constraint/ExceptionMessage.php index 62452bf17f3..c8e46959a59 100644 --- a/src/Framework/Constraint/ExceptionMessage.php +++ b/src/Framework/Constraint/ExceptionMessage.php @@ -36,11 +36,7 @@ public function __construct($expected) */ protected function matches($other) { - if ($this->expectedMessage === '') { - return $other->getMessage() === ''; - } - - return \strpos($other->getMessage(), $this->expectedMessage) !== false; + return $other->getMessage() === $this->expectedMessage; } /**