예제 #1
0
 /**
  * @covers ::current
  * @covers ::key
  * @covers ::next
  * @covers ::rewind
  * @covers ::valid
  */
 public function testIterator()
 {
     $source = [new Model(), new Model()];
     $models = new Models($source);
     $key = $models->key();
     foreach ($models as $i => $model) {
         $this->assertSame(current($source), $model);
         next($source);
     }
 }
예제 #2
0
파일: LinkMany.php 프로젝트: harp-orm/core
 /**
  * Implement Iterator
  */
 public function key()
 {
     return $this->current->key();
 }