Summary:
Fixes T4570. When a test case doesn't make any assertions, fail it:
- A tiny fraction of tests pass by not throwing. These tests can easily make a trivial assertion. It took about 5 minutes to fix them all (D8435, D8436).
- In other cases, no assertions means a test construction problem, as with T4570. In these cases, failing loudly catches a severe error.
- Fixes the no-assertion test cases in `arcanist/`
- Makes the PHP 5.4 test pass for the moment, see discussion in T4334.
Test Plan: Ran `arc unit --everything`.
Reviewers: leebyron, btrahan
Reviewed By: btrahan
CC: aran
Maniphest Tasks: T4570
Differential Revision: https://secure.phabricator.com/D8437
<?php
f()[0];
-$o->m()[0];
+ m()[0];
+
+// The check above should be this, see T4334.
+// $o->m()[0];
~~~~~~~~~~
disabled:3:5
} catch (Exception $e) {
// OK
}
+
+ $this->assertEqual(true, true);
}
public function testInvalidXmlInputFailure() {
} catch (Exception $e) {
// OK
}
+
+ $this->assertEqual(true, true);
}
}
$exceptions);
}
}
+
+ if (!$this->assertions) {
+ $this->failTest(
+ pht(
+ 'This test case made no assertions. Test cases must make at '.
+ 'least one assertion.'));
+ }
+
} catch (ArcanistPhutilTestTerminatedException $ex) {
// Continue with the next test.
} catch (ArcanistPhutilTestSkippedException $ex) {