Use two-letter language codes in RSS feeds, where available#265
Conversation
| $this->assertStringContainsString($str, $response); | ||
| } | ||
|
|
||
| // Ugly: our test harness inserts messages like "got an instance" and "called the actual controller", before and after the actual RSS/XML response document. Trim them off. |
There was a problem hiding this comment.
Do we know where these come form? A quick grep of our own code base doesn't turn up anything, and searching on GitHub the contents of phpunit and ci-phpunit-test doesn't find anything here. I'd much rather we get rid of these at the source if at all possible than working around them with hacks.
(But thanks for the code comment, I would have been left wondering otherwise).
There was a problem hiding this comment.
Long story short: that ugly hack is not necessary, and is now gone.
Looks like I made more assumptions about the environment resetting itself after my experiments. I can now, somewhat vaguely, recall my first-ever attempt at adding unit tests failing, so I added those debug messages into my vendor-ed ci-phpunit code, and found a bug in phpunit... which had already been found and fixed in another version. So I worked around it, and assumed the next git restore or ansible-playbook run would remove the messages. And then I forgot all about it. 🤣
Also removed a redundant RSS controller, which "swallowed up" the testing calls.
4222f8e to
375a8c1
Compare
Evidently, RSS feeds are supposed to use the two-letter language codes, instead of three. Switch to using two-letter codes where feasible:
https://forum.librivox.org/viewtopic.php?p=2479460#p2479460
A couple notes on tests. Evidently, we had a stub RSS controller file sitting around, and our test harness preferred to send requests to that, instead of to the real one. Also, our test harness includes little debug messages both before and after the response itself, so I had to do a little cleanup in order to validate the XML. That validation might be a standard part of any new tests I write going forward...