-
Bug
-
Resolution: Won't Do
-
Minor
-
None
-
2.6.4, 2.7.1
-
MOODLE_26_STABLE, MOODLE_27_STABLE
In MDL-43175, the comparison of event data with its decoded equivalent was relaxed so that floats which happened to be whole numbers would not throw unwanted debugging messages, but this comparison can fail for any float.
To replicate, add the following to lib/tests/event_test.php in the test_problematic_events() function:
// Check that other float numbers do not trigger debugging messages.
|
$event8 = \core_tests\event\unittest_executed::create(array('courseid'=>1, 'context'=>\context_system::instance(),
|
'other' => array('starttime' => microtime(true), 'wholenumber' => 90.0000, 'numberwithdecimals' => 54.7656, 'sample' => 1)));
|
$event8->trigger();
|
$this->assertDebuggingNotCalled();
|
The PHP documentation says "do not compare floating point numbers directly for equality" (http://php.net/manual/en/language.types.float.php)
- has a non-specific relationship to
-
MDL-43175 Base event JSON encoding decoding check will fail with whole float values.
-
- Closed
-