public function testOrderByDynamicField($field, $exception)
{
$this->primeBuilder();
$order1 = $this->createNode('Ordering', array(QOMConstants::JCR_ORDER_ASCENDING));
$orderBy = $this->createNode('OrderBy', array());
$orderBy->addChild($order1);
$op = $this->createNode('OperandDynamicField', array($field));
$order1->addChild($op);
if (null !== $exception) {
$this->setExpectedException('Doctrine\\ODM\\PHPCR\\Exception\\InvalidArgumentException', $exception);
}
$res = $this->converter->dispatch($orderBy);
$this->assertCount(1, $res);
}