Support the ongoing development of →
posted 9 years ago
Last updated 1 year ago.

Someone got any thoughts on this?

Last updated 1 year ago.

Got the same Question. There must be an Method to catch that Exception like $I->seeException(...)

Last updated 1 year ago.

I too am having issues with this, does anybody have any ideas?

Last updated 1 year ago.


Here a workaround... but it's not really perfect:

$I = new FunctionalTester($scenario);
$document = Document::first();

// NOTE: App::error() doesn't seem to work with Codeception
// So we need this try catch:
try {
} catch (Efficiently\AuthorityController\Exceptions\AccessDenied $e) {
    $message = $e->getMessage();
    Session::flash('error', $message);
$I->seeSessionHasValues(['error' => 'You are not authorized to access this page.']);

If someone has a better solution, it'll be really helpful!

NB: I mention this issue in the Testing Authority-Controller rules wiki page:

There is also a closed issue on the Codeception Github page, but the issue still occurs...

Last updated 1 year ago.

Sign in to participate in this thread!

Full Stack Europe

Your banner here too?

KarlPi karlpi Joined 20 Mar 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2023 - All rights reserved.