Returns a directive from the parsed list.
public getDirective ( string $key ) : string | ||
$key | string | |
return | string |
public function testDirectiveParsing() { $app = $this->getApp(); $qb = new ContentQueryParser($app['storage'], $app['query.select']); $qb->setQuery('entries'); $qb->setParameters(['order' => '-datepublish', 'id' => '!1']); $qb->parse(); $this->assertEquals(['entries'], $qb->getContentTypes()); $this->assertEquals('select', $qb->getOperation()); $this->assertEquals('-datepublish', $qb->getDirective('order')); $this->assertEquals('!1', $qb->getParameter('id')); $this->assertEquals(1, count($qb->getParameters())); }