Skip to content

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

Merged
taylorotwell merged 1 commit intolaravel:9.xfrom
nshiro:assert_database_has_multibyte
Jul 14, 2022
Merged

[9.x] Make assertDatabaseHas failureDescription more multibyte charac…#43181
taylorotwell merged 1 commit intolaravel:9.xfrom
nshiro:assert_database_has_multibyte

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