Issue Details (XML | Word | Printable)

Key: MDL-17534
Type: Bug Bug
Status: Open Open
Priority: Blocker Blocker
Assignee: moodle.com
Reporter: Petr Skoda
Votes: 0
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

execption thrown from unit test affects the code flow in simpletest framework itself

Created: 05/Dec/08 08:08 AM   Updated: 13/Nov/09 04:08 PM
Return to search
Component/s: Unit tests
Affects Version/s: 2.0
Fix Version/s: 2.0

Participants: mert gokkaya, moodle.com and Petr Skoda
Security Level: None
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
Sample code:

    function test_error_and_exception () {
        count(); // results in warning
        throw new exception('buuuuaa'); // this exception nukes simpletest
    }

    function test_fails_with_exception () {
        return;
    }

fails in both tests with:

Exception: lib/dml/simpletest/testdml.php / ? dml_test / ? test_error_and_exception
Unexpected exception of type [Exception] with message [buuuuaa] in [C:\workspace\moodle\lib\dml\simpletest\testdml.php line 65]

Exception: lib/dml/simpletest/testdml.php / ? dml_test / ? test_fails_with_exception
Unexpected PHP error [count() expects at least 1 parameter, 0 given] severity [E_WARNING] in [C:\workspace\moodle\lib\dml\simpletest\testdml.php line 64]

working on a temporary patch ;-)

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Skoda committed 3 files to 'Moodle CVS' - 05/Dec/08 08:19 AM
MDL-17534 simpletest: temporary fix for exception problems
MODIFY lib/simpletestlib/invoker.php   Rev. 1.4    (+13 -2 lines)
MODIFY lib/simpletestlib/readme_moodle.txt   Rev. 1.4    (+2 -1 lines)
MODIFY lib/simpletestlib/errors.php   Rev. 1.5    (+13 -2 lines)
Petr Skoda added a comment - 05/Dec/08 08:20 AM
Temporary fix in cvs, Nicolas could you please review it and try to find less hacky solution please?
We should also report it upstream

thanks


mert gokkaya added a comment - 27/Feb/09 01:10 PM
is this a bug about the test or the actual database problem? I keep getting dmlwrite/read errors on grouping creation and randomly on internal messaging. PHP 5.2.8 MySQL 5 Suse 11.1 Apache 2, clean moodle 2 install

Martin Dougiamas made changes - 13/Nov/09 04:08 PM
Field Original Value New Value
Assignee Nicolas Connault [ nicolasconnault ] moodle.com [ moodle.com ]