Skip to content

Commit

Permalink
add "Must be true" test
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed May 24, 2024
1 parent 557253c commit f8f8903
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/FieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,17 @@ public static function provideRequiredNumericZeroExceptionCases(): iterable
yield ['atk4_money'];
}

public function testRequiredBooleanZeroException(): void
{
$m = new Model();
$m->addField('foo', ['type' => 'boolean', 'required' => true]);
$m = $m->createEntity();

$this->expectException(ValidationException::class);
$this->expectExceptionMessage('Must be true');
$m->set('foo', 0);
}

public function testNotNullableNullInsertException(): void
{
$this->setDb([
Expand Down

0 comments on commit f8f8903

Please sign in to comment.