Skip to content

Commit

Permalink
test upcasting iterator keys
Browse files Browse the repository at this point in the history
  • Loading branch information
prolic committed Feb 11, 2017
1 parent 6797c6d commit a578736
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/Upcasting/UpcastingIteratorTest.php
Expand Up @@ -63,18 +63,23 @@ public function it_iterates(): void
$this->assertTrue($upcastingIterator->valid());
$this->assertSame($upcastedMessage1, $upcastingIterator->current());
$upcastingIterator->next();
$this->assertEquals(1, $upcastingIterator->key());
$this->assertSame($upcastedMessage2, $upcastingIterator->current());
$upcastingIterator->next();
$this->assertEquals(2, $upcastingIterator->key());
$this->assertSame($message3, $upcastingIterator->current());
$upcastingIterator->rewind();
$this->assertEquals(0, $upcastingIterator->key());
$this->assertTrue($upcastingIterator->valid());
$this->assertSame($upcastedMessage1, $upcastingIterator->current());
$upcastingIterator->next();
$this->assertEquals(1, $upcastingIterator->key());
$this->assertSame($upcastedMessage2, $upcastingIterator->current());
$upcastingIterator->next();
$this->assertEquals(2, $upcastingIterator->key());
$this->assertSame($message3, $upcastingIterator->current());
$upcastingIterator->next();
$this->assertEquals(3, $upcastingIterator->key());
$this->assertFalse($upcastingIterator->valid());
$this->assertNull($upcastingIterator->current());
}
Expand Down

0 comments on commit a578736

Please sign in to comment.