diff options
author | Shitiz Garg <mail@dragooon.net> | 2014-06-24 22:29:54 +0530 |
---|---|---|
committer | Shitiz Garg <mail@dragooon.net> | 2014-06-24 22:46:43 +0530 |
commit | e406cc6fadfc753369c1118c49bddca6523ee2db (patch) | |
tree | e9e83e8fb702c054c0106bdaa72a21cb18eec6b8 /tests/profilefields/type_date_test.php | |
parent | 15929201b8cadc64f4a0fbcb49ddf5b6426f79a6 (diff) | |
download | forums-e406cc6fadfc753369c1118c49bddca6523ee2db.tar forums-e406cc6fadfc753369c1118c49bddca6523ee2db.tar.gz forums-e406cc6fadfc753369c1118c49bddca6523ee2db.tar.bz2 forums-e406cc6fadfc753369c1118c49bddca6523ee2db.tar.xz forums-e406cc6fadfc753369c1118c49bddca6523ee2db.zip |
[ticket/12334] Add get_profile_value_raw unit test for type_date
PHPBB3-12334
Diffstat (limited to 'tests/profilefields/type_date_test.php')
-rw-r--r-- | tests/profilefields/type_date_test.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/profilefields/type_date_test.php b/tests/profilefields/type_date_test.php index 39fe95b97f..7f719d0f03 100644 --- a/tests/profilefields/type_date_test.php +++ b/tests/profilefields/type_date_test.php @@ -179,6 +179,42 @@ class phpbb_profilefield_type_date_test extends phpbb_test_case $this->assertSame($expected, $result, $description); } + public function get_profile_value_raw_data() + { + return array( + array( + '', + array('field_show_novalue' => false), + null, + 'Field should return the correct raw value', + ), + array( + '', + array('field_show_novalue' => true), + '', + 'Field should return correct raw value', + ), + array( + '12/06/2014', + array('field_show_novalue' => true), + '12/06/2014', + 'Field should return correct raw value', + ), + ); + } + + /** + * @dataProvider get_profile_value_raw_data + */ + public function test_get_profile_value_raw($value, $field_options, $expected, $description) + { + $field_options = array_merge($this->field_options, $field_options); + + $result = $this->cp->get_profile_value_raw($value, $field_options); + + $this->assertSame($expected, $result, $description); + } + public function return_callback_implode() { return implode('-', func_get_args()); |