From 20dfabc7c3c3654b54bc2b2dfac2007c9f7143c0 Mon Sep 17 00:00:00 2001 From: Rob Date: Fri, 10 Mar 2017 22:44:39 +0100 Subject: [PATCH] Add assertPathisNot function --- src/Concerns/MakesAssertions.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Concerns/MakesAssertions.php b/src/Concerns/MakesAssertions.php index 1085fa399..aab1b556c 100644 --- a/src/Concerns/MakesAssertions.php +++ b/src/Concerns/MakesAssertions.php @@ -51,6 +51,21 @@ public function assertPathIs($path) return $this; } + /** + * Assert that the current URL path does not match the given path. + * + * @param string $path + * @return $this + */ + public function assertPathIsNot($path) + { + PHPUnit::assertNotEquals($path, parse_url( + $this->driver->getCurrentURL() + )['path']); + + return $this; + } + /** * Assert that the current URL path matches the given route. *