Summer Sale! All accounts are 50% off this week.

stefr's avatar
Level 9

Strip whitespace in phpunit assertion

Hi, in my blade files, I have some data like:

<input type="radio"
    @if($some_var == 'whatever')
        checked="checked"
    @endif 
    value="{{ $my_id }}"
    id="something"
</input>

When I make an assertation in PHPUnit like below, it will fail because the linebreaks/white spaces are not ignored.

$response->assertSee('<input type="radio" value="1" id="something">');

Is there any way to assert while ignoring line breaks or whitespace?

0 likes
1 reply
netdjw's avatar

I faced similar issue. Is there any solution for you?

Please or to participate in this conversation.