Skip to content

[9.x] Mailable : fixes strict comparison with int value - #45138

Merged
taylorotwell merged 1 commit into
laravel:9.xfrom
MikeElghali:9.x
Nov 29, 2022
Merged

[9.x] Mailable : fixes strict comparison with int value#45138
taylorotwell merged 1 commit into
laravel:9.xfrom
MikeElghali:9.x

Conversation

@MikeElghali

Copy link
Copy Markdown
Contributor

This PR fixes the case when we set metadata with an integer value :

    // ExampleMail.php
    public function envelope(): Envelope
    {
        return new Envelope(
            from: 'hello@world.com',
            subject: 'Laravel',
            metadata: [
                'mailable_id' => 1,
            ],
        );
    }

    // ExampleMailTest.php
    public function test_mail_is_correct(): void
    {
        $mailable = new Mail();

        $mailable->assertHasMetadata('mailable_id', 1); // With this fix, it returns true
    }

@MikeElghali MikeElghali changed the title Mailable : fixes strict comparison with int value [9.x] Mailable : fixes strict comparison with int value Nov 29, 2022
@taylorotwell
taylorotwell merged commit 26941b0 into laravel:9.x Nov 29, 2022
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