public function theElementShouldNotBeVisible($element) { $exception = new \Exception("The element '{$element}' is visible"); $this->not(function () use($element) { $this->theElementShouldBeVisible($element); }, $exception); }