->andWhere("(mdso.xcode IS NOT NULL OR mdsh.xcode IS NOT NULL)");
$this->setExpectedException('Doctrine\DBAL\Query\QueryException',"The given alias 'ol' is not part of any FROM clause table. The currently registered FROM-clause aliases are: l");
$qb->select('COUNT(DISTINCT news.id)')
->from('cb_newspages','news')
->innerJoin('news','nodeversion','nv','nv.refId = news.id AND nv.refEntityname=\'News\'')
$this->setExpectedException('Doctrine\DBAL\Query\QueryException',"The given alias 'invalid' is not part of any FROM or JOIN clause table. The currently registered aliases are: news, nv, nt, n.");
$this->assertEquals("SELECT COUNT(DISTINCT news.id) FROM newspages news INNER JOIN nodeversion nv ON nv.refId = news.id AND nv.refEntityname='Entity\\News' INNER JOIN nodetranslation nt ON nv.nodetranslation = nt.id INNER JOIN node n ON nt.node = n.id WHERE (nt.lang = ?) AND (n.deleted = 0)",$qb->getSQL());