Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
mongo-php-library
Commits
964954e4
Unverified
Commit
964954e4
authored
Nov 11, 2019
by
Andreas Braun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify generator setup in tests
parent
52df7a11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
8 deletions
+1
-8
CachingIteratorTest.php
tests/Model/CachingIteratorTest.php
+1
-8
No files found.
tests/Model/CachingIteratorTest.php
View file @
964954e4
...
@@ -53,7 +53,7 @@ class CachingIteratorTest extends TestCase
...
@@ -53,7 +53,7 @@ class CachingIteratorTest extends TestCase
public
function
testPartialIterationDoesNotExhaust
()
public
function
testPartialIterationDoesNotExhaust
()
{
{
$traversable
=
$this
->
getTraversable
ThatThrows
([
1
,
2
,
new
Exception
()]);
$traversable
=
$this
->
getTraversable
([
1
,
2
,
new
Exception
()]);
$iterator
=
new
CachingIterator
(
$traversable
);
$iterator
=
new
CachingIterator
(
$traversable
);
$expectedKey
=
0
;
$expectedKey
=
0
;
...
@@ -110,13 +110,6 @@ class CachingIteratorTest extends TestCase
...
@@ -110,13 +110,6 @@ class CachingIteratorTest extends TestCase
}
}
private
function
getTraversable
(
$items
)
private
function
getTraversable
(
$items
)
{
foreach
(
$items
as
$item
)
{
yield
$item
;
}
}
private
function
getTraversableThatThrows
(
$items
)
{
{
foreach
(
$items
as
$item
)
{
foreach
(
$items
as
$item
)
{
if
(
$item
instanceof
Exception
)
{
if
(
$item
instanceof
Exception
)
{
...
...
Write
Preview
Markdown
is supported
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