Test was failing because
Value span-class-text-text-span-has-br-a is equal to value text-has-html-tags.
So for the text here
(string) SafeMarkup::checkPlain('This <span class="text">text</span>...
in PlainTextOutput::renderFromHtml($output);
instead of removing the html tags was just removing html entities generated from checkPlain();'This <span class="text">text</
So then we still have the words(span, class, etc) in the output.
I am not sure if is the way to fix that, decoding first and then removing the html tags.
Test was failing because Value span-class-text-text-span-has-br-a is equal to value text-has-html-tags. So for the text here
(string) SafeMarkup::checkPlain('This <span class="text">text</span>
...in
PlainTextOutput::renderFromHtml($output);
instead of removing the html tags was just removing html entities generated fromcheckPlain();
'This <span class="text">text</
So then we still have the words(span, class, etc) in the output. I am not sure if is the way to fix that, decoding first and then removing the html tags.