summaryrefslogtreecommitdiff
path: root/tests/units/Core/Session/FlashMessageTest.php
blob: 253613435cfe95531965fbe8338f9ae7b848fa82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php

require_once __DIR__.'/../../Base.php';

use Kanboard\Core\Session\FlashMessage;

class FlashMessageTest extends Base
{
    public function testMessage()
    {
        $flash = new FlashMessage($this->container);

        $flash->success('my message');
        $this->assertEquals('my message', $flash->getMessage('success'));
        $this->assertEmpty($flash->getMessage('success'));

        $flash->failure('my error message');
        $this->assertEquals('my error message', $flash->getMessage('failure'));
        $this->assertEmpty($flash->getMessage('failure'));

        $this->assertEmpty($flash->getMessage('not found'));
    }
}