Skip to content

Commit edbe04b

Browse files
committed
Merge pull request #183 from dragonwize/patch-1
[ORM] getRouteByName is supposed to return a single route
2 parents fbd5c74 + e9e9659 commit edbe04b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Doctrine/Orm/RouteProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ protected function getCandidates($url)
6262
*/
6363
public function getRouteByName($name, $parameters = array())
6464
{
65-
$route = $this->getRoutesRepository()->findBy(array('name' => $name));
65+
$route = $this->getRoutesRepository()->findOneBy(array('name' => $name));
6666
if (!$route) {
6767
throw new RouteNotFoundException("No route found for name '$name'");
6868
}

Tests/Unit/Doctrine/Orm/RouteProviderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function testGetRouteByName()
4646

4747
$this->objectRepository
4848
->expects($this->any())
49-
->method('findBy')
49+
->method('findOneBy')
5050
->with(array('name' => '/cms/routes/test-route'))
5151
->will($this->returnValue($this->route))
5252
;

0 commit comments

Comments
 (0)