Unit tests MDL-24994 Numerical question unit test was broken
authorSam Marshall <s.marshall@open.ac.uk>
Mon, 1 Nov 2010 15:46:58 +0000 (15:46 +0000)
committerSam Marshall <s.marshall@open.ac.uk>
Mon, 1 Nov 2010 15:46:58 +0000 (15:46 +0000)
question/type/numerical/simpletest/testquestiontype.php

index 125a14e..24f2346 100644 (file)
@@ -131,14 +131,14 @@ class question_numerical_qtype_test extends UnitTestCase {
             (object) array('unit' => 'inch', 'multiplier' => 1.0/0.0254)
         );
 
-        $this->assertWithinMargin($this->qtype->apply_unit_old('1', $units), 1, $this->tolerance);
-        $this->assertWithinMargin($this->qtype->apply_unit_old('1.0', $units), 1, $this->tolerance);
-        $this->assertWithinMargin($this->qtype->apply_unit_old('-1e0', $units), -1, $this->tolerance);
-        $this->assertWithinMargin($this->qtype->apply_unit_old('100m', $units), 100, $this->tolerance);
-        $this->assertWithinMargin($this->qtype->apply_unit_old('1cm', $units), 0.01, $this->tolerance);
-        $this->assertWithinMargin($this->qtype->apply_unit_old('12inch', $units), .3048, $this->tolerance);
+        $this->assertWithinMargin($this->qtype->apply_unit('1', $units), 1, $this->tolerance);
+        $this->assertWithinMargin($this->qtype->apply_unit('1.0', $units), 1, $this->tolerance);
+        $this->assertWithinMargin($this->qtype->apply_unit('-1e0', $units), -1, $this->tolerance);
+        $this->assertWithinMargin($this->qtype->apply_unit('100m', $units), 100, $this->tolerance);
+        $this->assertWithinMargin($this->qtype->apply_unit('1cm', $units), 0.01, $this->tolerance);
+        $this->assertWithinMargin($this->qtype->apply_unit('12inch', $units), .3048, $this->tolerance);
     //    $this->assertIdentical($this->qtype->apply_unit('1km', $units), false);
-        $this->assertWithinMargin($this->qtype->apply_unit_old('-100', array()), -100, $this->tolerance);
+        $this->assertWithinMargin($this->qtype->apply_unit('-100', array()), -100, $this->tolerance);
     //    $this->assertIdentical($this->qtype->apply_unit('1000 miles', array()), false);
     }