|
|
@ -47,7 +47,7 @@ class FrontControllerTest extends PHPUnit_Framework_TestCase |
|
|
|
$this->getMock('ErrorLayout', array('fetch', 'setException'), array(), 'ErrorLayoutMock'); |
|
|
|
} |
|
|
|
if (!class_exists('ErrorActionMock')) { |
|
|
|
$this->getMock('ErrorAction', array(), array(), 'ErrorActionMock', false); |
|
|
|
$this->getMock('ErrorAction', array('setAjaxError'), array(), 'ErrorActionMock', false); |
|
|
|
} |
|
|
|
set_new_overload(array($this, 'newCallback')); |
|
|
|
} |
|
|
@ -231,6 +231,21 @@ class FrontControllerTest extends PHPUnit_Framework_TestCase |
|
|
|
/** |
|
|
|
* @runInSeparateProcess |
|
|
|
*/ |
|
|
|
public function testExecuteWithAjaxActionError() |
|
|
|
{ |
|
|
|
$this->getMock('userAction'); |
|
|
|
$_SERVER['REQUEST_URI'] = '/user/account/213'; |
|
|
|
$this->setConstants(false); |
|
|
|
$controller = FrontController::getInstance(); |
|
|
|
$router = $controller->getRouter(); |
|
|
|
$router->add('user', 'user/account/:id', 'NewAjax'); |
|
|
|
$result = $controller->execute(); |
|
|
|
$this->assertNull($result); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @runInSeparateProcess |
|
|
|
*/ |
|
|
|
public function testExecuteWithAjaxActionProfiler() |
|
|
|
{ |
|
|
|
Config::set('PROFILER', true); |
|
|
@ -276,6 +291,9 @@ class FrontControllerTest extends PHPUnit_Framework_TestCase |
|
|
|
/** |
|
|
|
* Used in testExecuteWithAjaxAction |
|
|
|
*/ |
|
|
|
class NewAjaxAction extends AjaxAction{ |
|
|
|
protected function execute() {} |
|
|
|
class NewAjaxAction extends AjaxAction |
|
|
|
{ |
|
|
|
protected function execute() |
|
|
|
{ |
|
|
|
} |
|
|
|
} |