From 24b9fed88b70fdf7657a119ed2c1ce146133213b Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 28 Jun 2014 14:11:46 +0200 Subject: [PATCH] [ticket/277] Add tests for functions_modules.php B3P-277 --- .../unit/functions/functions_modules_test.php | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 tests/unit/functions/functions_modules_test.php diff --git a/tests/unit/functions/functions_modules_test.php b/tests/unit/functions/functions_modules_test.php new file mode 100644 index 00000000..4c586095 --- /dev/null +++ b/tests/unit/functions/functions_modules_test.php @@ -0,0 +1,76 @@ +assertEquals($expected, column_num_string($input)); + } + + public function data_column_string_num() + { + return array( + array(0, ''), + array(0, false), + array(1, 'left'), + array(2, 'center'), + array(3, 'right'), + array(4, 'top'), + array(5, 'bottom'), + ); + } + + /** + * @dataProvider data_column_string_num + */ + public function test_column_string_num($expected, $input) + { + $this->assertEquals($expected, column_string_num($input)); + } + + public function data_column_string_const() + { + return array( + array(0, ''), + array(0, ''), + array(2, 'left'), + array(4, 'center'), + array(8, 'right'), + array(1, 'top'), + array(16, 'bottom'), + ); + } + + /** + * @dataProvider data_column_string_const + */ + public function test_column_string_const($expected, $input) + { + $this->assertEquals($expected, column_string_const($input)); + } +}