diff --git a/src/Core/AbstractTest.php b/src/Core/AbstractTest.php index 2a25c73..7bed67d 100644 --- a/src/Core/AbstractTest.php +++ b/src/Core/AbstractTest.php @@ -192,25 +192,17 @@ public function applyFocusPatterns($focusPattern, $skipPattern = null) { $title = $this->getTitle(); - if ($focusPattern === null) { - $isFocused = true; - } else { - $isFocused = preg_match($focusPattern, $title); - } - - if (!$isFocused) { + if ($skipPattern !== null && preg_match($skipPattern, $title)) { $this->focused = false; return; } - if ($skipPattern === null) { + if ($focusPattern === null) { $this->focused = true; - - return; + } else { + $this->focused = preg_match($focusPattern, $title); } - - $this->focused = !preg_match($skipPattern, $title); } /**