aboutsummaryrefslogtreecommitdiffstats
path: root/tests/profilefields/type_url_test.php
diff options
context:
space:
mode:
authorShitiz Garg <mail@dragooon.net>2014-06-24 22:15:20 +0530
committerShitiz Garg <mail@dragooon.net>2014-06-24 22:15:20 +0530
commite9fbaac2124f96a41ff6633f23fd195e15db0bc7 (patch)
treee0a75a4a7251694340222c594b20de8cc44be43e /tests/profilefields/type_url_test.php
parent7a5afdeb4c05c55d6759c5ccf49a301cda4aa14c (diff)
downloadforums-e9fbaac2124f96a41ff6633f23fd195e15db0bc7.tar
forums-e9fbaac2124f96a41ff6633f23fd195e15db0bc7.tar.gz
forums-e9fbaac2124f96a41ff6633f23fd195e15db0bc7.tar.bz2
forums-e9fbaac2124f96a41ff6633f23fd195e15db0bc7.tar.xz
forums-e9fbaac2124f96a41ff6633f23fd195e15db0bc7.zip
[ticket/12334] Add get_profile_value_raw unit test for type_url
PHPBB3-12334
Diffstat (limited to 'tests/profilefields/type_url_test.php')
-rw-r--r--tests/profilefields/type_url_test.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/profilefields/type_url_test.php b/tests/profilefields/type_url_test.php
index 9957510d90..607cb7b9aa 100644
--- a/tests/profilefields/type_url_test.php
+++ b/tests/profilefields/type_url_test.php
@@ -104,6 +104,36 @@ class phpbb_profilefield_type_url_test extends phpbb_test_case
$this->assertSame($expected, $result, $description);
}
+ public function get_profile_value_raw_data()
+ {
+ return array(
+ array(
+ 'http://example.com',
+ array('field_show_novalue' => true),
+ 'http://example.com',
+ 'Field should return the correct raw value',
+ ),
+ array(
+ 'http://example.com',
+ array('field_show_novalue' => false),
+ 'http://example.com',
+ '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());