Permalink
Browse files

MDL-32234 Library: usergetdate tests moved to assertIdentical()

(to check both type and value)
  • Loading branch information...
1 parent 668f042 commit 39d59639e336eab959fee57f550450be7e8f2c23 @stronk7 stronk7 committed May 2, 2012
Showing with 20 additions and 20 deletions.
  1. +20 −20 lib/simpletest/testmoodlelib.php
View
40 lib/simpletest/testmoodlelib.php
@@ -573,31 +573,31 @@ function test_usergetdate() {
$arr = array_values($arr);
list($seconds,$minutes,$hours,$mday,$wday,$mon,$year,$yday,$weekday,$month) = $arr;
- $this->assertEqual($seconds,7);
- $this->assertEqual($minutes,51);
- $this->assertEqual($hours,4);
- $this->assertEqual($mday,23);
- $this->assertEqual($wday,3);
- $this->assertEqual($mon,12);
- $this->assertEqual($year,2009);
- $this->assertEqual($yday,356);
- $this->assertEqual($weekday, 'Wednesday');
- $this->assertEqual($month, 'December');
+ $this->assertIdentical($seconds, 7);
+ $this->assertIdentical($minutes, 51);
+ $this->assertIdentical($hours, 4);
+ $this->assertIdentical($mday, 23);
+ $this->assertIdentical($wday, 3);
+ $this->assertIdentical($mon, 12);
+ $this->assertIdentical($year, 2009);
+ $this->assertIdentical($yday, 356);
+ $this->assertIdentical($weekday, 'Wednesday');
+ $this->assertIdentical($month, 'December');
$arr = usergetdate($ts);//gets the timezone from the $USER object
$arr = array_values($arr);
list($seconds,$minutes,$hours,$mday,$wday,$mon,$year,$yday,$weekday,$month) = $arr;
- $this->assertEqual($seconds,7);
- $this->assertEqual($minutes,51);
- $this->assertEqual($hours,5);
- $this->assertEqual($mday,23);
- $this->assertEqual($wday,3);
- $this->assertEqual($mon,12);
- $this->assertEqual($year,2009);
- $this->assertEqual($yday,356);
- $this->assertEqual($weekday, 'Wednesday');
- $this->assertEqual($month, 'December');
+ $this->assertIdentical($seconds, 7);
+ $this->assertIdentical($minutes, 51);
+ $this->assertIdentical($hours, 5);
+ $this->assertIdentical($mday, 23);
+ $this->assertIdentical($wday, 3);
+ $this->assertIdentical($mon, 12);
+ $this->assertIdentical($year, 2009);
+ $this->assertIdentical($yday, 356);
+ $this->assertIdentical($weekday, 'Wednesday');
+ $this->assertIdentical($month, 'December');
//set the timezone back to what it was
$USER->timezone = $userstimezone;

0 comments on commit 39d5963

Please sign in to comment.