fix postgres test
This commit is contained in:
parent
68665af6e8
commit
8c407af1fc
@ -35,7 +35,7 @@ use Doctrine\Common\Collections\ArrayCollection;
|
||||
* @NamedNativeQuery(
|
||||
* name = "fetchUserPhonenumberCount",
|
||||
* resultSetMapping= "mappingUserPhonenumberCount",
|
||||
* query = "SELECT id, name, status, COUNT(phonenumber) AS numPhones FROM cms_users INNER JOIN cms_phonenumbers ON id = user_id WHERE username IN (?) GROUP BY id, name, status ORDER BY username"
|
||||
* query = "SELECT id, name, status, COUNT(phonenumber) AS numphones FROM cms_users INNER JOIN cms_phonenumbers ON id = user_id WHERE username IN (?) GROUP BY id, name, status, username ORDER BY username"
|
||||
* ),
|
||||
* })
|
||||
*
|
||||
@ -84,7 +84,7 @@ use Doctrine\Common\Collections\ArrayCollection;
|
||||
* )
|
||||
* },
|
||||
* columns = {
|
||||
* @ColumnResult("numPhones")
|
||||
* @ColumnResult("numphones")
|
||||
* }
|
||||
* )
|
||||
* })
|
||||
|
@ -540,12 +540,12 @@ class NativeQueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
// first user => 2 phonenumbers
|
||||
$this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0][0]);
|
||||
$this->assertEquals('Fabio B. Silva', $result[0][0]->name);
|
||||
$this->assertEquals(2, $result[0]['numPhones']);
|
||||
$this->assertEquals(2, $result[0]['numphones']);
|
||||
|
||||
// second user => 1 phonenumbers
|
||||
$this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[1][0]);
|
||||
$this->assertEquals('test tester', $result[1][0]->name);
|
||||
$this->assertEquals(1, $result[1]['numPhones']);
|
||||
$this->assertEquals(1, $result[1]['numphones']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user