Skip to content
Snippets Groups Projects
Commit f3c1c207 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

authpdo: fix wrong return type for getUserCount() #1781

parent 343a31d8
No related branches found
No related tags found
No related merge requests found
......@@ -171,21 +171,21 @@ class sqlite_plugin_authpdo_test extends DokuWikiTest {
$users = $auth->retrieveUsers(0, -1, array('group' => 'admin')); // full group
$this->assertEquals(array('admin', 'tester'), $users);
$count = $auth->getUserCount(array('group' => 'admin'));
$this->assertEquals(2, $count);
$this->assertSame(2, $count);
$users = $auth->retrieveUsers(0, -1, array('group' => 'dmi')); // substring
$this->assertEquals(array('admin', 'tester'), $users);
$count = $auth->getUserCount(array('group' => 'dmi'));
$this->assertEquals(2, $count);
$this->assertSame(2, $count);
$users = $auth->retrieveUsers(0, -1, array('user' => 'dmi')); // substring
$this->assertEquals(array('admin'), $users);
$count = $auth->getUserCount(array('user' => 'dmi'));
$this->assertEquals(1, $count);
$this->assertSame(1, $count);
// delete user
$num = $auth->deleteUsers(array('tester', 'foobar'));
$this->assertEquals(1, $num);
$this->assertSame(1, $num);
}
......
......@@ -446,7 +446,7 @@ class auth_plugin_authpdo extends DokuWiki_Auth_Plugin {
if(!$result || !isset($result[0]['count'])) {
$this->_debug("Statement did not return 'count' attribute", -1, __LINE__);
}
return isset($result[0]['count']);
return (int) $result[0]['count'];
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment