}); it('should not result in a pass and fail if tear down fails', function () { $test = new Test("passing", function () { }); $test->addTearDownFunction(function () { throw new Exception("failure"); }); $emitter = new EventEmitter(); $count = 0; $emitter->on('test.passed', function () use(&$count) { $count++; }); $emitter->on('test.failed', function () use(&$count) { $count++; }); $test->run(new TestResult($emitter)); assert($count == 1, "should not have emitted a pass and fail event"); }); }); }); describe("->getTitle()", function () { it("should return the full text for a spec including parents", function () { $root = new Suite("parent", function () { }); $child = new Suite("nested", function () { }); $test = new Test("should be rad", function () { }); $child->addTest($test); $root->addTest($child); assert($test->getTitle() == "parent nested should be rad", "title should include text from parents");