Skip to content

Commit e78cd9b

Browse files
committed
PHPC-282: Remove tests for multiple iterators on the same Cursor
1 parent 4e7df72 commit e78cd9b

File tree

3 files changed

+15
-135
lines changed

3 files changed

+15
-135
lines changed

tests/standalone/cursor-iterator_handlers-001.phpt

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -39,41 +39,33 @@ printf("Inserted: %d\n", $writeResult->getInsertedCount());
3939

4040
$cursor = $manager->executeQuery(NS, new MongoDB\Driver\Query(array()));
4141
$a = new MyIteratorIterator($cursor, 'A');
42-
$b = new MyIteratorIterator($cursor, 'B');
4342

4443
echo "\nBefore rewinding, position and current element are not populated:\n";
4544
$a->dump();
46-
$b->dump();
4745

4846
echo "\nAfter rewinding, current element is populated:\n";
4947
$a->rewind();
50-
$b->rewind();
5148
$a->dump();
52-
$b->dump();
5349

54-
echo "\nMultiple iterators have their own position, but share the same Cursor buffer:\n";
55-
$a->next();
56-
$a->dump();
57-
$b->next();
58-
$b->dump();
50+
echo "\nAfter advancing, next element is populated:\n";
5951
$a->next();
6052
$a->dump();
6153

6254
echo "\nRewinding only populates current element and does not alter position:\n";
6355
$a->rewind();
6456
$a->dump();
65-
$b->rewind();
66-
$b->dump();
6757

68-
echo "\nAdvancing first iterator until end of shared Cursor buffer is reached:\n";
58+
echo "\nAdvancing through remaining elements:\n";
59+
$a->next();
60+
$a->dump();
6961
$a->next();
7062
$a->dump();
7163
$a->next();
7264
$a->dump();
7365

74-
echo "\nRewinding second iterator to position it at end of shared Cursor buffer:\n";
75-
$b->rewind();
76-
$b->dump();
66+
echo "\nAdvancing beyond the last element:\n";
67+
$a->next();
68+
$a->dump();
7769

7870
?>
7971
===DONE===
@@ -83,25 +75,21 @@ Inserted: 5
8375

8476
Before rewinding, position and current element are not populated:
8577
A: null => null
86-
B: null => null
8778

8879
After rewinding, current element is populated:
8980
A: 0 => {_id: 0}
90-
B: 0 => {_id: 0}
9181

92-
Multiple iterators have their own position, but share the same Cursor buffer:
82+
After advancing, next element is populated:
9383
A: 1 => {_id: 1}
94-
B: 1 => {_id: 2}
95-
A: 2 => {_id: 3}
9684

9785
Rewinding only populates current element and does not alter position:
98-
A: 2 => {_id: 3}
99-
B: 1 => {_id: 3}
86+
A: 1 => {_id: 1}
10087

101-
Advancing first iterator until end of shared Cursor buffer is reached:
102-
A: 3 => {_id: 4}
103-
A: null => null
88+
Advancing through remaining elements:
89+
A: 2 => {_id: 2}
90+
A: 3 => {_id: 3}
91+
A: 4 => {_id: 4}
10492

105-
Rewinding second iterator to position it at end of shared Cursor buffer:
106-
B: null => null
93+
Advancing beyond the last element:
94+
A: null => null
10795
===DONE===

tests/standalone/cursor-multiple_iterators-001.phpt

Lines changed: 0 additions & 50 deletions
This file was deleted.

tests/standalone/cursor-multiple_iterators-002.phpt

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)