Skip to content

Commit

Permalink
Test case for phalcon#1275
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Oct 19, 2013
1 parent 5e27ed2 commit b617bab
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions ext/tests/issue-1275.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
--TEST--
No action or controller set for view in v1.2.4 - https://github.com/phalcon/cphalcon/issues/1275
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
<?php
/**
* @RoutePrefix("/hello")
*/
class HelloController extends \Phalcon\Mvc\Controller
{
/**
* @Get("/test")
*/
public function testAction()
{
echo $this->dispatcher->getControllerName(), PHP_EOL;
}
}

$di = new \Phalcon\DI\FactoryDefault();
$di->setShared('view', function() { return new \Phalcon\Mvc\View(); });
$di->setShared('router',
function()
{
$router = new \Phalcon\Mvc\Router\Annotations(false);
$router->setUriSource(Phalcon\Mvc\Router::URI_SOURCE_SERVER_REQUEST_URI);
$router->addResource('Hello');
return $router;
}
);

$application = new \Phalcon\Mvc\Application($di);

$_SERVER['REQUEST_METHOD'] = 'GET';
$_SERVER['REQUEST_URI'] = '/hello/test';
echo $application->handle()->getContent();
?>
--EXPECT--
Hello

0 comments on commit b617bab

Please sign in to comment.