Use namedparameter

This commit is contained in:
Roeland Jago Douma 2016-01-11 15:58:32 +01:00
parent 4d037b76b4
commit 0f454ff5aa
2 changed files with 3 additions and 9 deletions

View File

@ -185,8 +185,7 @@ class DefaultShareProvider implements IShareProvider {
$qb = $this->dbConn->getQueryBuilder();
$qb->select('*')
->from('share')
->where($qb->expr()->eq('parent', $qb->createParameter('parent')))
->setParameter(':parent', $parent->getId())
->where($qb->expr()->eq('parent', $qb->createNamedParameter($parent->getId())))
->orderBy('id');
$cursor = $qb->execute();
@ -210,8 +209,7 @@ class DefaultShareProvider implements IShareProvider {
$qb = $this->dbConn->getQueryBuilder();
$qb->delete('share')
->where($qb->expr()->eq('id', $qb->createParameter('id')))
->setParameter(':id', $share->getId());
->where($qb->expr()->eq('id', $qb->createNamedParameter($share->getId())));
try {
$qb->execute();
@ -244,8 +242,7 @@ class DefaultShareProvider implements IShareProvider {
$qb->select('*')
->from('share')
->where($qb->expr()->eq('id', $qb->createParameter('id')))
->setParameter(':id', $id);
->where($qb->expr()->eq('id', $qb->createNamedParameter($id)));
$cursor = $qb->execute();
$data = $cursor->fetch();

View File

@ -374,9 +374,6 @@ class DefaultShareProviderTest extends \Test\TestCase {
$qb->expects($this->once())
->method('where')
->will($this->returnSelf());
$qb->expects($this->once())
->method('setParameter')
->will($this->returnSelf());
$qb->expects($this->once())
->method('execute')
->will($this->throwException(new \Exception));