Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
7e2bff85
Commit
7e2bff85
authored
10 years ago
by
Thomas Müller
Browse files
Options
Downloads
Patches
Plain Diff
adding unit test to truncate the table
parent
7458e21f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/user_ldap/lib/helper.php
+1
-1
1 addition, 1 deletion
apps/user_ldap/lib/helper.php
apps/user_ldap/tests/helper.php
+31
-0
31 additions, 0 deletions
apps/user_ldap/tests/helper.php
with
32 additions
and
1 deletion
apps/user_ldap/lib/helper.php
+
1
−
1
View file @
7e2bff85
...
@@ -172,7 +172,7 @@ class Helper {
...
@@ -172,7 +172,7 @@ class Helper {
}
}
/**
/**
* extractsthe domain from a given URL
* extracts
the domain from a given URL
* @param string $url the URL
* @param string $url the URL
* @return string|false domain as string on success, false otherwise
* @return string|false domain as string on success, false otherwise
*/
*/
...
...
This diff is collapsed.
Click to expand it.
apps/user_ldap/tests/helper.php
0 → 100644
+
31
−
0
View file @
7e2bff85
<?php
/**
* ownCloud
*
* @author Thomas Müller
* @copyright 2014 Thomas Müller deepdiver@owncloud.com
*
*/
namespace
OCA\user_ldap\tests
;
use
OCA\user_ldap
\lib\Helper
;
class
Test_Helper
extends
\PHPUnit_Framework_TestCase
{
public
function
testTableTruncate
()
{
$statement
=
\OCP\DB
::
prepare
(
'INSERT INTO `*PREFIX*ldap_user_mapping` (`ldap_dn`, `owncloud_name`, `directory_uuid`) VALUES (?, ?, ?)'
);
$statement
->
execute
(
array
(
'db01'
,
'oc1'
,
'000-0000-0000'
));
$statement
->
execute
(
array
(
'db02'
,
'oc2'
,
'000-0000-0001'
));
$statement
=
\OCP\DB
::
prepare
(
'SELECT count(*) FROM `*PREFIX*ldap_user_mapping`'
);
$result
=
$statement
->
execute
();
$this
->
assertEquals
(
2
,
$result
->
fetchOne
());
Helper
::
clearMapping
(
'user'
);
$result
=
$statement
->
execute
();
$this
->
assertEquals
(
0
,
$result
->
fetchOne
());
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment