Skip to content

Commit 5ab8487

Browse files
committed
test: add test for is_unique and int value
1 parent 7f789ac commit 5ab8487

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

tests/system/Validation/StrictRules/DatabaseRelatedRulesTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,21 @@ public function testIsUniqueByManualRun(): void
138138
$this->assertFalse($this->createRules()->is_unique('deva@example.com', 'user.email,id,{id}', []));
139139
}
140140

141+
public function testIsUniqueIntValueByManualRun(): void
142+
{
143+
Database::connect()
144+
->table('user')
145+
->insert([
146+
'name' => 'Developer A',
147+
'email' => 'deva@example.com',
148+
'country' => 'Elbonia',
149+
]);
150+
151+
$result = $this->createRules()->is_unique(1, 'user.id', []);
152+
153+
$this->assertFalse($result);
154+
}
155+
141156
public function testIsNotUniqueFalse(): void
142157
{
143158
Database::connect()

0 commit comments

Comments
 (0)