Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
6c335ee6
Commit
6c335ee6
authored
10 years ago
by
Arthur Schiwon
Browse files
Options
Downloads
Patches
Plain Diff
add test for mapping's getList method
parent
ae9c9a46
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/user_ldap/tests/mapping/abstractmappingtest.php
+24
-0
24 additions, 0 deletions
apps/user_ldap/tests/mapping/abstractmappingtest.php
with
24 additions
and
0 deletions
apps/user_ldap/tests/mapping/abstractmappingtest.php
+
24
−
0
View file @
6c335ee6
...
...
@@ -191,4 +191,28 @@ abstract class AbstractMappingTest extends \Test\TestCase {
$this
->
assertFalse
(
$name
);
}
}
/**
* tests getList() method
*/
public
function
testList
()
{
list
(
$mapper
,
$data
)
=
$this
->
initTest
();
// get all entries without specifying offset or limit
$results
=
$mapper
->
getList
();
$this
->
assertSame
(
3
,
count
(
$results
));
// get all-1 entries by specifying offset, and an high limit
// specifying only offset without limit will not work by underlying lib
$results
=
$mapper
->
getList
(
1
,
999
);
$this
->
assertSame
(
count
(
$data
)
-
1
,
count
(
$results
));
// get first 2 entries by limit, but not offset
$results
=
$mapper
->
getList
(
null
,
2
);
$this
->
assertSame
(
2
,
count
(
$results
));
// get 2nd entry by specifying both offset and limit
$results
=
$mapper
->
getList
(
1
,
1
);
$this
->
assertSame
(
1
,
count
(
$results
));
}
}
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