diff options
| author | Marc Alexander <admin@m-a-styles.de> | 2013-06-03 21:30:13 +0200 |
|---|---|---|
| committer | Marc Alexander <admin@m-a-styles.de> | 2013-06-03 21:30:13 +0200 |
| commit | 11678678b810c26376728166cf334550cbc30124 (patch) | |
| tree | 4811af80294223ca68195ee0d27e99be2761ff9a /tests/functions/validate_data_helper.php | |
| parent | c2bc82ebfd54cebba03bd04dccaf5a8e317844ae (diff) | |
| download | forums-11678678b810c26376728166cf334550cbc30124.tar forums-11678678b810c26376728166cf334550cbc30124.tar.gz forums-11678678b810c26376728166cf334550cbc30124.tar.bz2 forums-11678678b810c26376728166cf334550cbc30124.tar.xz forums-11678678b810c26376728166cf334550cbc30124.zip | |
[ticket/11579] Rework calls to validate_data_helper
PHPBB3-11579
Diffstat (limited to 'tests/functions/validate_data_helper.php')
| -rw-r--r-- | tests/functions/validate_data_helper.php | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/tests/functions/validate_data_helper.php b/tests/functions/validate_data_helper.php index b8e8bfded3..94ddf60429 100644 --- a/tests/functions/validate_data_helper.php +++ b/tests/functions/validate_data_helper.php @@ -20,19 +20,17 @@ class phpbb_functions_validate_data_helper extends PHPUnit_Framework_TestCase * Test provided input data with supplied checks and compare to expected * results * - * @param array $expected Array containing the expected results. Either - * an array containing the error message or the an empty - * array if input is correct - * @param array $input Input data with specific array keys that need to - * be matched by the ones in the other 2 params - * @param array $validate_check Array containing validate_data check - * settings, i.e. array('foobar' => array('string')) + * @param array $data Array containing one or more subarrays with the + * test data. The first element of a subarray is the + * expected result, the second one is the input, and the + * third is the data that should be passed to the function + * validate_data(). */ - public function assert_validate_data($expected, $input, $validate_check) + public function assert_valid_data($data) { - foreach ($input as $key => $data) + foreach ($data as $key => $test) { - $this->test_case->assertEquals($expected[$key], validate_data(array($data), array($validate_check[$key]))); + $this->test_case->assertEquals($test[0], validate_data(array($test[1]), array($test[2]))); } } } |
