From c95ce1dc5264f30676f4860d68c06c651b80ae87 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Wed, 28 Jul 2010 15:03:04 +0000 Subject: [PATCH] NOBUG qtype numerical fix unit test. --- .../type/numerical/simpletest/testquestiontype.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/question/type/numerical/simpletest/testquestiontype.php b/question/type/numerical/simpletest/testquestiontype.php index 24f2346a480..125a14e924b 100644 --- a/question/type/numerical/simpletest/testquestiontype.php +++ b/question/type/numerical/simpletest/testquestiontype.php @@ -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('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->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->assertIdentical($this->qtype->apply_unit('1km', $units), false); - $this->assertWithinMargin($this->qtype->apply_unit('-100', array()), -100, $this->tolerance); + $this->assertWithinMargin($this->qtype->apply_unit_old('-100', array()), -100, $this->tolerance); // $this->assertIdentical($this->qtype->apply_unit('1000 miles', array()), false); }