use Data namespace
This commit is contained in:
parent
71d49def6b
commit
a5b80681c9
21 changed files with 283 additions and 68 deletions
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
namespace Tests\Http;
|
||||
|
||||
use Icefox\DTO\IDataObject;
|
||||
use Icefox\Data\IData;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Support\Facades\Validator as ValidatorFacade;
|
||||
use Illuminate\Validation\Validator;
|
||||
|
||||
readonly class Basic implements IDataObject
|
||||
readonly class Basic implements IData
|
||||
{
|
||||
public string $reply;
|
||||
public function __construct(string $message)
|
||||
|
|
@ -35,7 +35,7 @@ test('fails on validation error', function () {
|
|||
]);
|
||||
});
|
||||
|
||||
readonly class WithCustomValidator implements IDataObject
|
||||
readonly class WithCustomValidator implements IData
|
||||
{
|
||||
public string $reply;
|
||||
public function __construct(string $message)
|
||||
|
|
@ -66,7 +66,7 @@ test('replies with custom validator', function () {
|
|||
]);
|
||||
});
|
||||
|
||||
readonly class WithCustomFailure implements IDataObject
|
||||
readonly class WithCustomFailure implements IData
|
||||
{
|
||||
public function __construct(public bool $flag) {}
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ test('uses custom response', function () {
|
|||
->assertJson(['result' => 'invalid, but that is ok']);
|
||||
});
|
||||
|
||||
readonly class WithDefaultObjectOnFailure implements IDataObject
|
||||
readonly class WithDefaultObjectOnFailure implements IData
|
||||
{
|
||||
public function __construct(public bool $flag) {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue