Skip to content

Commit 71fdd5f

Browse files
committed
test regexp
1 parent 42757c6 commit 71fdd5f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

tests/ConditionSqlTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,13 +440,20 @@ public function testLikeCondition(): void
440440

441441
$t = (clone $u)->addCondition('name', 'like', '%John%');
442442
$this->assertCount(1, $t->export());
443+
$t = (clone $u)->addCondition('name', 'regexp', '^Joh');
444+
$this->assertCount(1, $t->export());
443445

444446
$t = (clone $u)->addCondition('name', 'like', '%john%');
445447
$this->assertCount(1, $t->export());
448+
$t = (clone $u)->addCondition('name', 'regexp', '^joh');
449+
$this->assertCount(1, $t->export());
446450

447451
$t = (clone $u)->addCondition('created', 'like', '%19%');
448452
$this->assertCount(2, $t->export()); // only year 2019 records
449453

454+
$t = (clone $u)->addCondition('created', 'regexp', '19');
455+
$this->assertCount(2, $t->export());
456+
450457
$t = (clone $u)->addCondition('active', 'like', '%1%');
451458
$this->assertCount(2, $t->export()); // only active records
452459

0 commit comments

Comments
 (0)