Support the ongoing development of →
posted 10 years ago
Last updated 2 years ago.

Someone got any thoughts on this?

Last updated 2 years ago.

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

Last updated 2 years ago.

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

Last updated 2 years 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 2 years ago.

Sign in to participate in this thread!


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.

© 2024 - All rights reserved.