Improved moodlelib_test to illustrate wrong style of writing unit tests
authorDavid Mudrak <david.mudrak@gmail.com>
Tue, 12 Oct 2010 12:56:41 +0000 (12:56 +0000)
committerDavid Mudrak <david.mudrak@gmail.com>
Tue, 12 Oct 2010 12:56:41 +0000 (12:56 +0000)
Sorry for this irritating commit but I believe it is the most effective
way how to demonstrate the issue.

lib/simpletest/testmoodlelib.php

index 2ae68cb..dcebab8 100644 (file)
@@ -462,8 +462,8 @@ class moodlelib_test extends UnitTestCase {
         $this->assertEqual($mon,12);
         $this->assertEqual($year,2009);
         $this->assertEqual($yday,357);
-        $this->assertEqual($weekday,'Wednesday');
-        $this->assertEqual($month,'December');
+        $this->assertEqual($weekday,'Středa');
+        $this->assertEqual($month,'prosinec');
 
         $arr = usergetdate($ts);//gets the timezone from the $USER object
         $arr = array_values($arr);
@@ -477,8 +477,8 @@ class moodlelib_test extends UnitTestCase {
         $this->assertEqual($mon,12);
         $this->assertEqual($year,2009);
         $this->assertEqual($yday,357);
-        $this->assertEqual($weekday,'Wednesday');
-        $this->assertEqual($month,'December');
+        $this->assertEqual($weekday,'Středa');
+        $this->assertEqual($month,'prosinec');
 
         //set the timezone back to what it was
         $USER->timezone = $userstimezone;