Skip to content

Commit ed7aa2b

Browse files
committed
test method should return bool
1 parent fdff107 commit ed7aa2b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/VerbalExpressions/PHPVerbalExpressions/VerbalExpressions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ public function test($value)
476476
return preg_match_all($this->getRegex(), $value);
477477
}
478478

479-
return preg_match($this->getRegex(), $value);
479+
return (bool) preg_match($this->getRegex(), $value);
480480
}
481481

482482
/**

tests/VerbalExpressions/PHPVerbalExpressions/VerbalExpressionsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function testUrlPatterns($url)
2020
->anythingBut(" ")
2121
->endOfLine();
2222

23-
$this->assertEquals(1, $regex->test($url));
23+
$this->assertTrue($regex->test($url));
2424
}
2525

2626
static public function provideUrls()

0 commit comments

Comments
 (0)