Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
6c335ee6
Commit
6c335ee6
authored
Jan 07, 2015
by
Arthur Schiwon
Browse files
add test for mapping's getList method
parent
ae9c9a46
Changes
1
Hide whitespace changes
Inline
Side-by-side
apps/user_ldap/tests/mapping/abstractmappingtest.php
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
));
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment