4
votes

How to handle internationalization in cakephp 3 when doing unit testing ? In my case I need to do assertResponseContains('Tilføj') which contains 'ø' character and for some reason phpunit cant read it properly, therefore the test fails even though the response contains the given word. Any suggestions ? .

1
Are you sure your files are all encoded properly, using UTF8? Then it should match just fine afaik.mark
Yes its all set properly.radioaktiv

1 Answers

2
votes

I have found the solution. I was actually running the test from a command line that was not able to display correctly the "Ø" letter. So the solution was actually to change the code page of the terminal to UTF-8 with chcp 65001 icommand