Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebauman committed May 8, 2024
1 parent d07a9fe commit 7b785db
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/Unit/Models/ModelAttributeCastTest.php
Expand Up @@ -28,6 +28,10 @@ public function test_boolean_attributes_are_casted()
$this->assertTrue($model->booleanAttribute);
$this->assertEquals($model->getRawAttribute('booleanAttribute'), ['TRUE']);

$model->booleanAttribute = 'false';
$this->assertFalse($model->booleanAttribute);
$this->assertEquals($model->getRawAttribute('booleanAttribute'), ['FALSE']);

// Casing differences

$model = (new ModelCastStub)->setRawAttributes(['boolAttribute' => ['true']]);
Expand Down

0 comments on commit 7b785db

Please sign in to comment.