ValidationFailure tests
This commit is contained in:
parent
709201547c
commit
f1d46dacb6
7 changed files with 264 additions and 5 deletions
23
tests/Classes/FailsReturnsDefault.php
Normal file
23
tests/Classes/FailsReturnsDefault.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Classes;
|
||||
|
||||
use Icefox\DTO\DataObject;
|
||||
use Illuminate\Validation\Validator;
|
||||
|
||||
readonly class FailsReturnsDefault
|
||||
{
|
||||
use DataObject;
|
||||
|
||||
public function __construct(
|
||||
public string $string,
|
||||
public int $int = 42,
|
||||
) {}
|
||||
|
||||
public static function fails(Validator $validator): ?static
|
||||
{
|
||||
return new self(string: 'default_value');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue