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

Error in phpunit. #112

Tjoosten opened this issue Aug 6, 2017 · 3 comments

Error in phpunit. #112

Tjoosten opened this issue Aug 6, 2017 · 3 comments


Copy link

@Tjoosten Tjoosten commented Aug 6, 2017

Hi i'm testing my application out but now i got a strange error.

My steps:

Can someone help me?

Copy link

@paulhenri-l paulhenri-l commented Aug 13, 2017

Try with this one

    protected function assertFlash($level, $message, $important = false, $title = null, $overlay = false)
        $expectedNotification = [
            'title' => $title,
            'message' => $message,
            'level' => $level,
            'important' => $important,
            'overlay' => $overlay

        $flashNotifications = json_decode(json_encode(session('flash_notification')), true);

            "Failed asserting that the flash message '$message' is present."
Copy link

@sandervanhooft sandervanhooft commented Jan 29, 2018

@paulhenri-l Amazing solution, thanks!

Minor improvement:

if (! $flashNotifications) {
	$this->fail('Failed asserting that a flash message was sent.');

I created a gist for this here.

Copy link

@sandervanhooft sandervanhooft commented Apr 9, 2018

I have been using this assertFlash method so much lately I decided to write a short blog post on it here.

Thanks again @paulhenri-l !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants