summaryrefslogtreecommitdiff
path: root/lib/plugins/usermanager/_test
diff options
context:
space:
mode:
Diffstat (limited to 'lib/plugins/usermanager/_test')
-rw-r--r--lib/plugins/usermanager/_test/csv_import.test.php14
-rw-r--r--lib/plugins/usermanager/_test/mocks.class.php8
2 files changed, 22 insertions, 0 deletions
diff --git a/lib/plugins/usermanager/_test/csv_import.test.php b/lib/plugins/usermanager/_test/csv_import.test.php
index 1f0ee7436..5133c1256 100644
--- a/lib/plugins/usermanager/_test/csv_import.test.php
+++ b/lib/plugins/usermanager/_test/csv_import.test.php
@@ -150,6 +150,20 @@ importiso8859,"F'.chr(0xF8).'rd Prefect",ford@example.com,user
$this->doImportTest($csv, true, $expected, array());
}
+ /**
+ * Verify usermanager::str_getcsv() behaves identically to php 5.3's str_getcsv()
+ * within the context/parameters required by _import()
+ *
+ * @requires PHP 5.3
+ * @deprecated remove when dokuwiki requires 5.3+
+ * also associated usermanager & mock usermanager access methods
+ */
+ private function test_getcsvcompatibility() {
+ $line = 'importuser,"Ford Prefect",ford@example.com,user'.NL;
+
+ $this->assertEquals(str_getcsv($line), $this->usermanager->access_str_getcsv($line));
+ }
+
private function stripPasswords($array){
foreach ($array as $user => $data) {
unset($array[$user]['pass']);
diff --git a/lib/plugins/usermanager/_test/mocks.class.php b/lib/plugins/usermanager/_test/mocks.class.php
index f3cc72c27..91c74768c 100644
--- a/lib/plugins/usermanager/_test/mocks.class.php
+++ b/lib/plugins/usermanager/_test/mocks.class.php
@@ -26,6 +26,14 @@ class admin_mock_usermanager extends admin_plugin_usermanager {
return $this->_import();
}
+ /**
+ * @deprecated remove when dokuwiki requires php 5.3+
+ * also associated unit test & usermanager methods
+ */
+ public function access_str_getcsv($line){
+ return $this->str_getcsv($line);
+ }
+
// no need to send email notifications (mostly)
protected function _notifyUser($user, $password, $status_alert=true) {
if ($this->mock_email_notifications) {