Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.3.0] Regression test for Issue #1258 #1260

Merged
merged 2 commits into from Sep 20, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ before_script:
- ulimit -c unlimited || true

script:
- (cd ext; NO_INTERACTION=1 make test)
- $(phpenv which php) ./unit-tests/ci/phpunit.php --debug -c unit-tests/phpunit.xml
- PHALCON_NO_RVO=1 $(phpenv which php) ./unit-tests/ci/phpunit.php --debug -c unit-tests/phpunit.xml

Expand Down
50 changes: 50 additions & 0 deletions ext/tests/issue-1258.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
--TEST--
Segmentation fault in zim_Phalcon_Mvc_Dispatcher__throwDispatchException - https://github.com/phalcon/cphalcon/issues/1258
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
<?php

class Secure extends Phalcon\Mvc\User\Plugin
{
public function beforeDispatch(\Phalcon\Events\Event $event, \Phalcon\Mvc\Dispatcher $dispatcher)
{
$acl = new \Phalcon\Acl\Adapter\Memory();
$acl->setDefaultAction(Phalcon\Acl::ALLOW);
$acl->addRole(new \Phalcon\Acl\Role('test'));

$acl->isAllowed('test' , 'test' , 'test');
$acl->isAllowed('test' , 'test' , 'test');
}
}

$di = new \Phalcon\DI\FactoryDefault();
$di->set(
'dispatcher',
function () use ($di) {
$eventsManager = $di->getShared('eventsManager');

$secure = new \Secure($di);
$eventsManager->attach('dispatch' , $secure);

$dispatcher = new \Phalcon\Mvc\Dispatcher();
$dispatcher->setEventsManager($eventsManager);

return $dispatcher;
}
);

$di['view'] = function(){
return new Phalcon\Mvc\View();
};

$application = new \Phalcon\Mvc\Application($di);
try {
$application->handle()->getContent();
}
catch (Exception $e) {
echo $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
IndexController handler class cannot be loaded