Make TestCase::hasOutput() return true if "0" is outputted

TestCase::hasOutput() returns false when "0" is outputted, as it uses empty(), which returns false on the string "0".
Merge pull request #922 from dave1010/3.7