diff --git a/application/tests/helpers/Locale_helper_test.php b/application/tests/helpers/Locale_helper_test.php new file mode 100644 index 000000000..4b7994215 --- /dev/null +++ b/application/tests/helpers/Locale_helper_test.php @@ -0,0 +1,22 @@ +assertEquals(2.22, $decimals); + } + + public function test_format_decimals() + { + $decimals = to_decimals(5, 2); + + $this->assertEquals(5.00, $decimals); + } + + +} diff --git a/application/tests/libraries/Barcode_lib_test.php b/application/tests/libraries/Barcode_lib_test.php index aae2632ef..e6cdc009b 100644 --- a/application/tests/libraries/Barcode_lib_test.php +++ b/application/tests/libraries/Barcode_lib_test.php @@ -9,7 +9,6 @@ class Barcode_lib_test extends UnitTestCase $this->resetInstance(); $this->obj = $this->newLibrary('Barcode_lib'); - } public function test_barcode_weight_first() @@ -21,8 +20,8 @@ class Barcode_lib_test extends UnitTestCase $this->obj->parse_barcode_fields($quantity, $item_number); echo $quantity; - $this->assertEquals($quantity, 123.456); - $this->assertEquals($item_number, "50000"); + $this->assertEquals(123.456, $quantity); + $this->assertEquals("50000", $item_number); } public function test_barcode_weight_last() @@ -33,7 +32,7 @@ class Barcode_lib_test extends UnitTestCase $quantity = 0; $this->obj->parse_barcode_fields($quantity, $item_number); - $this->assertEquals($quantity, 50.001); - $this->assertEquals($item_number, 123456); + $this->assertEquals(50.001, $quantity); + $this->assertEquals(123456, $item_number); } } \ No newline at end of file