Recently, I've started to working on Email2SMS feature in our product. When I joined the project this component had zero code coverage by unit-tests. Legacy code.
Since I started to working on it, I was using test-first approach. But code quality was very low. It was very hard to split it and tests small chunks by unit-tests, so I decided to write integration test.
There is php script, which accepts some message info, search for user in DB and save some info if everything is OK.
$last_line = system('php emailtosms.php -file=unicode_message.txt ', $retval);
$this->assertStringExistsInLogFile('Email to SMS message was not sent');
Is it bad or not? How would you solve this problem?