Inheritance: implements Neos\Flow\Persistence\QueryResultInterface
 /**
  * @test
  */
 public function iteratorMethodsAreCorrectlyImplemented()
 {
     $array1 = ['foo' => 'Foo1', 'bar' => 'Bar1'];
     $array2 = ['foo' => 'Foo2', 'bar' => 'Bar2'];
     $this->assertEquals($array1, $this->queryResult->current());
     $this->assertTrue($this->queryResult->valid());
     $this->queryResult->next();
     $this->assertEquals($array2, $this->queryResult->current());
     $this->assertTrue($this->queryResult->valid());
     $this->assertEquals(1, $this->queryResult->key());
     $this->queryResult->next();
     $this->assertFalse($this->queryResult->current());
     $this->assertFalse($this->queryResult->valid());
     $this->assertNull($this->queryResult->key());
     $this->queryResult->rewind();
     $this->assertEquals(0, $this->queryResult->key());
     $this->assertEquals($array1, $this->queryResult->current());
 }
Esempio n. 2
0
 /**
  * Returns the query result count
  *
  * @return integer The query result count
  * @api
  */
 public function count()
 {
     $result = new QueryResult($this);
     return $result->count();
 }