1
0
mirror of synced 2025-01-19 06:51:40 +03:00

fix postgres test

This commit is contained in:
Fabio B. Silva 2012-02-28 23:46:28 -03:00
parent 68665af6e8
commit 8c407af1fc
2 changed files with 4 additions and 4 deletions

View File

@ -35,7 +35,7 @@ use Doctrine\Common\Collections\ArrayCollection;
* @NamedNativeQuery( * @NamedNativeQuery(
* name = "fetchUserPhonenumberCount", * name = "fetchUserPhonenumberCount",
* resultSetMapping= "mappingUserPhonenumberCount", * 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 = { * columns = {
* @ColumnResult("numPhones") * @ColumnResult("numphones")
* } * }
* ) * )
* }) * })

View File

@ -540,12 +540,12 @@ class NativeQueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
// first user => 2 phonenumbers // first user => 2 phonenumbers
$this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0][0]); $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0][0]);
$this->assertEquals('Fabio B. Silva', $result[0][0]->name); $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 // second user => 1 phonenumbers
$this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[1][0]); $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[1][0]);
$this->assertEquals('test tester', $result[1][0]->name); $this->assertEquals('test tester', $result[1][0]->name);
$this->assertEquals(1, $result[1]['numPhones']); $this->assertEquals(1, $result[1]['numphones']);
} }
/** /**