Skip to content

[12.x] Add Enum support for assertJsonPath in AssertableJsonString.php#55516

Merged
taylorotwell merged 4 commits into
laravel:12.xfrom
azim-kordpour:12.x
Apr 23, 2025
Merged

[12.x] Add Enum support for assertJsonPath in AssertableJsonString.php#55516
taylorotwell merged 4 commits into
laravel:12.xfrom
azim-kordpour:12.x

Conversation

@azim-kordpour

Copy link
Copy Markdown
Contributor

Hi,
To improve code readability and prevent typos, I added Enum support for assertJsonPath in this PR.

// Before
$this->postJson('book')
     ->assertJsonPath('data.status', BookingStatus::Booked->value);
// After
$this->postJson('book')
     ->assertJsonPath('data.status', BookingStatus::Booked);

Comment thread src/Illuminate/Testing/AssertableJsonString.php Outdated
azim-kordpour and others added 2 commits April 23, 2025 11:17
Co-authored-by: Sebastian Hädrich <11225821+shaedrich@users.noreply.github.com>
@azim-kordpour

Copy link
Copy Markdown
Contributor Author

@shaedrich
Thank you for the suggestion.

@shaedrich

Copy link
Copy Markdown
Contributor

@azim-kordpour You're welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants