In my blade, I have a button:
<a
href="/customer/member/delete/{{ $member->id }}"
class="btn btn-secondary delete-button"
>
Delete
</a>
And I want to test it:
$this->view->assertSee('<a href="/customer/member/delete/1" class="btn btn-secondary delete-button">Delete</a>');
How can I ignore whitespaces in the test? A tried: trim and string_replace, but they have not solved the problem.
2
Answers
You can split to strings and use
false
like second arguments to NOT escape:It works from Laravel 7+
Try this:
And you can use like this:
Now you can use whitespaces in your blade file and in your test string too.
You can extend preg_replace rules as you wish.