I look for the way to take the smallest id of a city to avoid an error in my unitarian test. After try, I have this error:
Doctrine\ORM\Query\QueryException: [Syntax Error] line 0, col 62:
Error: Expected =, <, <=, <>, >, >=, !=, got 'AS'
public function testDB()
{
$id = $this->entityManager
->getRepository('AppBundle:City')
->createQueryBuilder('b')
->where("MIN(b.id) AS id")
->getQuery()
->getResult();
}