I ran into a problem that nothing was printed when 0 was given as the value for function TemplateProcessor->setValue(). I tracked this issue down to the function ensureUtf8Encoded that checked if $subject was true, instead of is not null.
I changed the line to check if $subject is null and only then return a empty string else the value is send to Text::toUTF8().
The test I wrote might be a bit overkill, but I hope it sufficient to test te fix
Checklist:
[x] I have run composer run-script check --timeout=0 and no errors were reported
[x] The new code is covered by unit tests (check build/coverage for coverage report)
[ ] I have updated the documentation to describe the changes
coverage: 97.217%. remained the same
when pulling cb1ba73c909932d1de5314c0bfdd7fd00db6d31a on SnipsMine:master
into 8b891bb6842dd383f679b47898fad0b7c181f325 on PHPOffice:master.
Description
I ran into a problem that nothing was printed when 0 was given as the value for function TemplateProcessor->setValue(). I tracked this issue down to the function ensureUtf8Encoded that checked if $subject was true, instead of is not null.
I changed the line to check if $subject is null and only then return a empty string else the value is send to Text::toUTF8().
The test I wrote might be a bit overkill, but I hope it sufficient to test te fix
Checklist:
composer run-script check --timeout=0
and no errors were reported