From: SourceForge.net <no...@so...> - 2009-10-23 08:29:03
|
Patches item #2884553, was opened at 2009-10-23 10:29 Message generated for change (Tracker Item Submitted) made by thuse You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=547457&aid=2884553&group_id=76550 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Tarjei Huse (thuse) Assigned to: Nobody/Anonymous (nobody) Summary: assertLinkById and assertLink blow up on error Initial Comment: When using assertLinkById in a test and the test fails, it causes a fatal error because of a missing test. Example of the errormessage: Fatal error: Call to a member function asString() on a non-object in simpletest/simpletest/trunk/web_tester.php on line 1110 Call Stack: 0.0328 4411400 1. simpletest_autorun() simpletest/simpletest/trunk/autorun.php:0 0.0328 4411724 2. run_local_tests() simpletest/simpletest/trunk/autorun.php:28 0.0341 4476968 3. TestSuite->run() simpletest/simpletest/trunk/autorun.php:52 0.0354 4478632 4. SimpleTestCase->run() simpletest/simpletest/trunk/test_case.php:559 0.0366 4483136 5. SimpleErrorTrappingInvoker->invoke() simpletest/simpletest/trunk/test_case.php:144 0.0367 4483964 6. SimpleInvokerDecorator->invoke() simpletest/simpletest/trunk/errors.php:42 0.0367 4483964 7. SimpleExceptionTrappingInvoker->invoke() simpletest/simpletest/trunk/invoker.php:126 0.0367 4484608 8. SimpleInvokerDecorator->invoke() simpletest/simpletest/trunk/exceptions.php:43 0.0367 4484608 9. SimpleInvoker->invoke() simpletest/simpletest/trunk/invoker.php:126 0.0367 4484608 10. VarmepumpeinfoWebTest->test_forhandlersok() simpletest/simpletest/trunk/invoker.php:68 0.6545 4702144 11. WebTestCase->assertLinkById() test_sometest.php:48 I tried to create a failing test for this in acceptancetests: --- test/acceptance_test.php (revision 1968) +++ test/acceptance_test.php (working copy) @@ -319,7 +320,13 @@ $this->assertTrue($this->clickLinkById(1)); $this->assertText('target for the SimpleTest'); } + function testLinkIdFollowingFail() { + // $this->expectException(); <-- expectException could be usefull for the webtest as well... + $this->get($this->samples() . 'link_confirm.php'); + $this->assertLinkById("test-link-that-does-not-exist"); + } But I didn't get it to work. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=547457&aid=2884553&group_id=76550 |