We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0878875 commit 4e71c1aCopy full SHA for 4e71c1a
src/Operator/Comparator/RegexpOperator.php
@@ -18,6 +18,6 @@ final class RegexpOperator extends AbstractCompareTwo
18
19
public function executeComparison(mixed $expr1, mixed $expr2): bool
20
{
21
- return (bool) preg_match($expr2, $expr1);
+ return preg_match($expr2, $expr1) !== false;
22
}
23
tests/Operator/Comparator/RegexpOperatorTest.php
@@ -0,0 +1,15 @@
1
+<?php
2
+
3
+namespace LogicTree\Test\Operator\Comparator;
4
5
+use LogicTree\Operator\Comparator\RegexpOperator;
6
7
+class RegexpOperatorTest extends \PHPUnit\Framework\TestCase
8
+{
9
10
+ public function testItMatchesExactMatch()
11
+ {
12
+ $this->assertTrue((new RegexpOperator())->executeComparison('toto', '/^[A-Z]+/'));
13
+ }
14
15
+}
0 commit comments