Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[9.x] Make assertDatabaseHas failureDescription more multibyte charac… #43181

Merged
merged 1 commit into from
Jul 14, 2022

Conversation

nshiro
Copy link
Contributor

@nshiro nshiro commented Jul 14, 2022

When assertDatabaseHas test fails, it shows you similar or found results.
While it's helpful, sometimes it can be difficult to see for those using multibyte languages.

This PR solves that problem.

sample test

    /** @test */
    function dbtest()
    {
        User::factory()->create([
            'name' => '名無しの権兵衛',
            'email' => '太郎@example.net'
        ]);

        $this->assertDatabaseHas(User::class, [
            'name' => '名無しの権兵衛',
            'email' => '次郎@example.net'
        ]);
    }

Before

2022-07-14_15h24_45

After

2022-07-14_15h28_24

This is a small addition, yet it helps us a lot.
Thank you always.

@taylorotwell taylorotwell merged commit a83e96a into laravel:9.x Jul 14, 2022
@nshiro nshiro deleted the assert_database_has_multibyte branch July 14, 2022 14:09
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.

2 participants