/** * Test test "compare()" in Assignments.class.inc. */ public function testcompare() { // Must send it three structured arrays of lessons. One with more than // 100% assigned and the other with less and one exact. // Should return 0 for equal. -1 for greater than and 1 for less than. $x['tA_PercentTime'] = 0; $y['tA_PercentTime'] = 110; $z['tA_PercentTime'] = 100; $ac_class_instance = new AssignmentsClass(); $test1 = $ac_class_instance->compare($x, $x); $this->assertTrue($test1 === 0); // Equal returns 0. $test2 = $ac_class_instance->compare($y, $z); $this->assertTrue($test2 === -1); // Greater returns -1. $test3 = $ac_class_instance->compare($z, $y); // Less than returns 1. $this->assertTrue($test3 === 1); }