Skip to content

Commit

Permalink
Add test.
Browse files Browse the repository at this point in the history
  • Loading branch information
david_smith committed Oct 24, 2024
1 parent 0723743 commit b12c2e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/Unit/Describe/Default/BaseClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ class BaseClass
use DataModel;

public const string = 'string';
public const bool = 'bool';

#[Describe(['default' => '1'])]
public string $string;

#[Describe(['default' => false])]
public bool $bool;
}
7 changes: 7 additions & 0 deletions tests/Unit/Describe/Default/ClassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,11 @@ class ClassTest extends TestCase

$this->assertEquals('1', $BaseClass->string);
}

#[Test] public function from_boolean(): void
{
$BaseClass = BaseClass::from();

$this->assertFalse($BaseClass->bool);
}
}

0 comments on commit b12c2e2

Please sign in to comment.