mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Improved moodlelib_test to illustrate wrong style of writing unit tests
Sorry for this irritating commit but I believe it is the most effective way how to demonstrate the issue.
This commit is contained in:
parent
5b9199a04b
commit
e54c41da0b
1 changed files with 4 additions and 4 deletions
|
@ -462,8 +462,8 @@ class moodlelib_test extends UnitTestCase {
|
||||||
$this->assertEqual($mon,12);
|
$this->assertEqual($mon,12);
|
||||||
$this->assertEqual($year,2009);
|
$this->assertEqual($year,2009);
|
||||||
$this->assertEqual($yday,357);
|
$this->assertEqual($yday,357);
|
||||||
$this->assertEqual($weekday,'Wednesday');
|
$this->assertEqual($weekday,'Středa');
|
||||||
$this->assertEqual($month,'December');
|
$this->assertEqual($month,'prosinec');
|
||||||
|
|
||||||
$arr = usergetdate($ts);//gets the timezone from the $USER object
|
$arr = usergetdate($ts);//gets the timezone from the $USER object
|
||||||
$arr = array_values($arr);
|
$arr = array_values($arr);
|
||||||
|
@ -477,8 +477,8 @@ class moodlelib_test extends UnitTestCase {
|
||||||
$this->assertEqual($mon,12);
|
$this->assertEqual($mon,12);
|
||||||
$this->assertEqual($year,2009);
|
$this->assertEqual($year,2009);
|
||||||
$this->assertEqual($yday,357);
|
$this->assertEqual($yday,357);
|
||||||
$this->assertEqual($weekday,'Wednesday');
|
$this->assertEqual($weekday,'Středa');
|
||||||
$this->assertEqual($month,'December');
|
$this->assertEqual($month,'prosinec');
|
||||||
|
|
||||||
//set the timezone back to what it was
|
//set the timezone back to what it was
|
||||||
$USER->timezone = $userstimezone;
|
$USER->timezone = $userstimezone;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue