Doctrine named queries

Code
<?php

use Doctrine\ORM\Mapping as A;

/**
 * @A\NamedQueries({
 *   @A\NamedQuery(
 *     name = "onlyTestWithNameEqFoo",
 *     query = "SELECT t FROM Test t WHERE t.name = 'foo'" 
 *   )
 * })
 *
 * @A\Entity
 * @A\Table(name="test")
 */
class Test
{
    
/**
     * @A\Column(type="integer", name="id")
     * @A\Id
     * @A\GeneratedValue(strategy="AUTO")
     */
    
public $id;
    
    
/** 
     * @A\Column(type="string", name="name", length=255)
     */
    
public $name;
    
    
/** 
     * @A\Column(type="datetime", name="creation_date", nullable=true)
     */
    
public $creationDate;
}

$query $entityManager->getRepository(Test::class)
    ->
createNamedQuery('onlyTestWithNameEqFoo')
    ->
getResult();
dump($query[0]);

$entityManager->getConfiguration()
    ->
addNamedQuery(
        
'onlyTestWithNameEqBar',
        
'SELECT t FROM Test t WHERE t.name = \'bar\''
    
);
$query $entityManager->createNamedQuery('onlyTestWithNameEqBar')
    ->
getResult();
dump($query[0]);
Result
Test {#379
+id: 1
+name: "foo"
+creationDate: DateTime {#359
+"date": "2014-07-20 11:37:29.000000"
+"timezone_type": 3
+"timezone": "Europe/Berlin"
}
}

Test {#406
+id: 3
+name: "bar"
+creationDate: DateTime {#381
+"date": "2014-07-23 07:27:18.000000"
+"timezone_type": 3
+"timezone": "Europe/Berlin"
}
}
Used Versions
PHP 7.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6