From: Jason Woofenden Date: Fri, 9 Apr 2010 17:47:33 +0000 (-0400) Subject: added unit tests for format_options X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=commitdiff_plain;h=84660f52dded89e3affdff636f8bdfa2adfe3629 added unit tests for format_options --- diff --git a/unit_tests/db.php b/unit_tests/db.php index 4906f1b..f6b5325 100644 --- a/unit_tests/db.php +++ b/unit_tests/db.php @@ -1,6 +1,6 @@ 'Eno', 'two' => 'Owt', 'symbols&\'"' => 'Slobmys'), PULLDOWN_HASH); + $errors +=_test_format_options('hash', 'one', 'one'); + $errors +=_test_format_options('hash', 'One', ''); + $errors +=_test_format_options('hash', 'two', 'two'); + $errors +=_test_format_options('hash', 'symbols&\'"', ''); + pulldown('array_2d', array(array('one', 'Eno'), array('two', 'Owt'), array('symbols&\'"', 'Slobmys')), PULLDOWN_2D); + $errors +=_test_format_options('array_2d', 'one', 'one'); + $errors +=_test_format_options('array_2d', 'One', ''); + $errors +=_test_format_options('array_2d', 'two', 'two'); + $errors +=_test_format_options('array_2d', 'symbols&\'"', ''); + + return $errors; +} + +# returns number of errors function format_unit_tests_main() { $errors = 0; $errors += test_format_money(); $errors += test_format_misc(); + $errors += test_format_options(); return $errors; }