summaryrefslogtreecommitdiff
path: root/tests/units/Helper
diff options
context:
space:
mode:
Diffstat (limited to 'tests/units/Helper')
-rw-r--r--tests/units/Helper/AppHelperTest.php10
-rw-r--r--tests/units/Helper/UserHelperTest.php19
2 files changed, 11 insertions, 18 deletions
diff --git a/tests/units/Helper/AppHelperTest.php b/tests/units/Helper/AppHelperTest.php
index cbd8b8ab..0639b7aa 100644
--- a/tests/units/Helper/AppHelperTest.php
+++ b/tests/units/Helper/AppHelperTest.php
@@ -2,7 +2,7 @@
require_once __DIR__.'/../Base.php';
-use Kanboard\Core\Session;
+use Kanboard\Core\Session\FlashMessage;
use Kanboard\Helper\App;
use Kanboard\Model\Config;
@@ -23,15 +23,15 @@ class AppHelperTest extends Base
public function testFlashMessage()
{
$h = new App($this->container);
- $s = new Session;
+ $f = new FlashMessage($this->container);
$this->assertEmpty($h->flashMessage());
- $s->flash('test & test');
+
+ $f->success('test & test');
$this->assertEquals('<div class="alert alert-success alert-fade-out">test &amp; test</div>', $h->flashMessage());
$this->assertEmpty($h->flashMessage());
- $this->assertEmpty($h->flashMessage());
- $s->flashError('test & test');
+ $f->failure('test & test');
$this->assertEquals('<div class="alert alert-error">test &amp; test</div>', $h->flashMessage());
$this->assertEmpty($h->flashMessage());
}
diff --git a/tests/units/Helper/UserHelperTest.php b/tests/units/Helper/UserHelperTest.php
index 4cc9fa65..eba977ee 100644
--- a/tests/units/Helper/UserHelperTest.php
+++ b/tests/units/Helper/UserHelperTest.php
@@ -6,7 +6,6 @@ use Kanboard\Helper\User;
use Kanboard\Model\Project;
use Kanboard\Model\ProjectPermission;
use Kanboard\Model\User as UserModel;
-use Kanboard\Core\Session;
class UserHelperTest extends Base
{
@@ -24,7 +23,6 @@ class UserHelperTest extends Base
$p = new Project($this->container);
$pp = new ProjectPermission($this->container);
$u = new UserModel($this->container);
- $session = new Session;
// We create our user
$this->assertEquals(2, $u->create(array('username' => 'unittest', 'password' => 'unittest')));
@@ -36,7 +34,7 @@ class UserHelperTest extends Base
$this->assertFalse($pp->isManager(1, 2));
// We fake a session for him
- $session['user'] = array(
+ $this->container['sessionStorage']->user = array(
'id' => 2,
'is_admin' => false,
'is_project_admin' => true,
@@ -51,7 +49,6 @@ class UserHelperTest extends Base
$p = new Project($this->container);
$pp = new ProjectPermission($this->container);
$u = new UserModel($this->container);
- $session = new Session;
// We create our user
$this->assertEquals(2, $u->create(array('username' => 'unittest', 'password' => 'unittest')));
@@ -63,7 +60,7 @@ class UserHelperTest extends Base
$this->assertFalse($pp->isManager(1, 2));
// We fake a session for him
- $session['user'] = array(
+ $this->container['sessionStorage']->user = array(
'id' => 2,
'is_admin' => false,
'is_project_admin' => false,
@@ -78,7 +75,6 @@ class UserHelperTest extends Base
$p = new Project($this->container);
$pp = new ProjectPermission($this->container);
$u = new UserModel($this->container);
- $session = new Session;
// We create our user
$this->assertEquals(2, $u->create(array('username' => 'unittest', 'password' => 'unittest')));
@@ -90,7 +86,7 @@ class UserHelperTest extends Base
$this->assertTrue($pp->isManager(1, 2));
// We fake a session for him
- $session['user'] = array(
+ $this->container['sessionStorage']->user = array(
'id' => 2,
'is_admin' => false,
'is_project_admin' => false,
@@ -105,7 +101,6 @@ class UserHelperTest extends Base
$p = new Project($this->container);
$pp = new ProjectPermission($this->container);
$u = new UserModel($this->container);
- $session = new Session;
// We create our user
$this->assertEquals(2, $u->create(array('username' => 'unittest', 'password' => 'unittest')));
@@ -117,7 +112,7 @@ class UserHelperTest extends Base
$this->assertFalse($pp->isManager(1, 2));
// We fake a session for him
- $session['user'] = array(
+ $this->container['sessionStorage']->user = array(
'id' => 2,
'is_admin' => false,
'is_project_admin' => true,
@@ -132,7 +127,6 @@ class UserHelperTest extends Base
$p = new Project($this->container);
$pp = new ProjectPermission($this->container);
$u = new UserModel($this->container);
- $session = new Session;
// We create our user
$this->assertEquals(2, $u->create(array('username' => 'unittest', 'password' => 'unittest')));
@@ -144,7 +138,7 @@ class UserHelperTest extends Base
$this->assertFalse($pp->isManager(1, 2));
// We fake a session for him
- $session['user'] = array(
+ $this->container['sessionStorage']->user = array(
'id' => 2,
'is_admin' => false,
'is_project_admin' => false,
@@ -159,7 +153,6 @@ class UserHelperTest extends Base
$p = new Project($this->container);
$pp = new ProjectPermission($this->container);
$u = new UserModel($this->container);
- $session = new Session;
// We create our user
$this->assertEquals(2, $u->create(array('username' => 'unittest', 'password' => 'unittest')));
@@ -171,7 +164,7 @@ class UserHelperTest extends Base
$this->assertTrue($pp->isManager(1, 2));
// We fake a session for him
- $session['user'] = array(
+ $this->container['sessionStorage']->user = array(
'id' => 2,
'is_admin' => false,
'is_project_admin' => false,