Builds an executes a query whichs searches and sorts documents from a repository.
Пример #1
0
 public function testBadData()
 {
     $path = __DIR__ . '/fixtures/datastore/querytest';
     $config = new Config($path . '/');
     $repo = new Repository('baddata', $config);
     $query = new Query($repo);
     $result = $query->execute();
     $this->assertEquals(1, count($result));
 }
Пример #2
0
 public function testOrderBy()
 {
     $path = __DIR__ . '/fixtures/datastore/querytest';
     $config = new Config($path . '/');
     $repo = new Repository('countries', $config);
     $query = new Query($repo);
     $query->orderBy('age ASC');
     $this->assertAttributeEquals(array('age ASC'), 'orderBy', $query);
     $query->orderBy(array('surname DESC', 'age DESC'));
     $this->assertAttributeEquals(array('surname DESC', 'age DESC'), 'orderBy', $query);
 }