diff --git a/ext/mvc/router/annotations.c b/ext/mvc/router/annotations.c index 00589285f0d..e7b90950e38 100644 --- a/ext/mvc/router/annotations.c +++ b/ext/mvc/router/annotations.c @@ -528,7 +528,7 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, processActionAnnotation){ } phalcon_array_update_string(&paths, ISL(controller), controller, PH_COPY); - phalcon_array_update_string(&paths, ISL(action), action_name, PH_COPY); + phalcon_array_update_string(&paths, ISL(action), real_action_name, PH_COPY); phalcon_array_update_string(&paths, SL("\0exact"), PHALCON_GLOBAL(z_true), PH_COPY); PHALCON_INIT_VAR(position); diff --git a/unit-tests/RouterMvcAnnotationsTest.php b/unit-tests/RouterMvcAnnotationsTest.php index f3c345891a2..b2db514d677 100644 --- a/unit-tests/RouterMvcAnnotationsTest.php +++ b/unit-tests/RouterMvcAnnotationsTest.php @@ -48,6 +48,14 @@ public function saveAction() } + /** + * @Route("/delete/{id:[0-9]+}", methods={"POST", "DELETE"}, name="delete-robot") + */ + public function deleteRobotAction() + { + + } + } class ProductsController @@ -100,7 +108,7 @@ public function testRouterFullResources() $router->handle(); - $this->assertEquals(count($router->getRoutes()), 6); + $this->assertEquals(count($router->getRoutes()), 7); $route = $router->getRouteByName('save-robot'); $this->assertTrue(is_object($route)); @@ -160,6 +168,13 @@ public function testRouterFullResources() 'action' => 'save', 'params' => array() ), + array( + 'uri' => '/robots/delete/100', + 'method' => 'POST', + 'controller' => 'Robots', + 'action' => 'deleteRobot', + 'params' => array('id' => '100') + ), ); foreach ($routes as $route) {