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:
David Mudrak 2010-10-12 12:56:41 +00:00
parent 5b9199a04b
commit e54c41da0b

View file

@ -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;