-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add test case for model state assertion without JSON fields.
- Loading branch information
Konstantin Lapkovsky
committed
Dec 19, 2023
1 parent
6728f2b
commit d31ee75
Showing
5 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
tests/fixtures/ModelTestStateTest/assertion_fixture_without_json_fields.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"updated": [ | ||
{ | ||
"id": 1, | ||
"name": "name1 updated" | ||
} | ||
], | ||
"created": [ | ||
{ | ||
"id": 4, | ||
"name": "name44", | ||
"created_at": "2018-10-10 10:10:10", | ||
"updated_at": "2018-10-10 10:10:10" | ||
} | ||
], | ||
"deleted": [ | ||
{ | ||
"id": 5, | ||
"name": "name5", | ||
"created_at": "2018-10-10 10:10:10", | ||
"updated_at": "2018-10-10 10:10:10" | ||
} | ||
] | ||
} |
26 changes: 26 additions & 0 deletions
26
...xtures/ModelTestStateTest/changes_equals_fixture_without_json_fields/changed_dataset.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[ | ||
{ | ||
"id": 1, | ||
"name": "name1 updated", | ||
"created_at": "2018-10-10 10:10:10", | ||
"updated_at": "2018-10-10 10:10:10" | ||
}, | ||
{ | ||
"id": 2, | ||
"name": "name2", | ||
"created_at": "2018-10-10 10:10:10", | ||
"updated_at": "2018-10-10 10:10:10" | ||
}, | ||
{ | ||
"id": 3, | ||
"name": "name3", | ||
"created_at": "2018-10-10 10:10:10", | ||
"updated_at": "2018-10-10 10:10:10" | ||
}, | ||
{ | ||
"id": 4, | ||
"name": "name44", | ||
"created_at": "2018-10-10 10:10:10", | ||
"updated_at": "2018-10-10 10:10:10" | ||
} | ||
] |
26 changes: 26 additions & 0 deletions
26
...xtures/ModelTestStateTest/changes_equals_fixture_without_json_fields/initial_dataset.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[ | ||
{ | ||
"id": 1, | ||
"name": "name1", | ||
"created_at": "2018-10-10 10:10:10", | ||
"updated_at": "2018-10-10 10:10:10" | ||
}, | ||
{ | ||
"id": 2, | ||
"name": "name2", | ||
"created_at": "2018-10-10 10:10:10", | ||
"updated_at": "2018-10-10 10:10:10" | ||
}, | ||
{ | ||
"id": 3, | ||
"name": "name3", | ||
"created_at": "2018-10-10 10:10:10", | ||
"updated_at": "2018-10-10 10:10:10" | ||
}, | ||
{ | ||
"id": 5, | ||
"name": "name5", | ||
"created_at": "2018-10-10 10:10:10", | ||
"updated_at": "2018-10-10 10:10:10" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace RonasIT\Support\Tests\Support\Mock; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
use RonasIT\Support\Traits\ModelTrait; | ||
use Illuminate\Database\Eloquent\SoftDeletes; | ||
|
||
class TestModelWithoutJsonFields extends Model | ||
{ | ||
use ModelTrait, SoftDeletes; | ||
|
||
protected $fillable = [ | ||
'name', | ||
]; | ||
} |