I am attempting to create an acceptance tests which looks for a line of text that also contains a copyright symbol (c)
. I have tried using:
$I->see('© 2016 MyCompany, LLC');
Using an html escape character with the assertion fails. Any tips on how to make codeception see the copyright symbol?
see
method matches decoded html entities, so you have to use the actual character as advised by Sammitch.
The alternative way is to use seeInSource method and match the entity as it is in the HTML:
$I->seeInSource('© 2016 MyCompany, LLC');
Update: I checked the edit history and it appears that you used the actual © character in original question.
I did a quick test and $I->see('© 2016 MyCompany, LLC')
matched both © and ©
, so it should be working for you. Make sure that your test file is saved as UTF-8 and your website is using UTF-8.
If you use a different charset, use character codes in assertion.