Skip to content

assertStringContainsString doesn't display the specified message #1146

@efcor

Description

@efcor

Dusk Version

8.2.9

Laravel Version

11.28.1

PHP Version

8.3.12

PHPUnit Version

11.4.2

Database Driver & Version

No response

Description

When doing $this->assertStringContainsString('foo', 'bar', 'My custom message.'); in a test, Dusk's output for that test does not display "My custom message." I double checked and assertStringContainsString does have a third parameter for a message, similar to assertSame.

If you do $this->assertSame('foo', 'bar', 'My custom message.'); in a test, Dusk's output for that test will render "My custom message" as expected.

$this->assertSame('foo', 'bar', 'My custom message.');

Screenshot 2024-10-21 at 11 53 06 AM

$this->assertStringContainsString('foo', 'bar', 'My custom message.');
Screenshot 2024-10-21 at 11 53 22 AM

Steps To Reproduce

Be on Mac OS 14.6.1 (Apple Silicon)
Have Chrome Version 130.0.6723.59 (Official Build) (arm64)

Run:
laravel new laravel (no scaffolding etc in the wizard)
composer require laravel/dusk --dev
cd laravel
herd link

php artisan dusk:install
php artisan dusk:chrome-driver

Add $this->assertStringContainsString('foo', 'bar', 'My custom message.'); to the Tests\Browser\ExampleTest test.

Run php artisan dusk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions