Save task list order in user session

This commit is contained in:
Timo
2020-04-23 05:40:39 +02:00
committed by GitHub
parent e089d3059a
commit 027f875ac6
3 changed files with 60 additions and 2 deletions

View File

@@ -97,6 +97,28 @@ class UserSessionTest extends Base
$this->assertEquals('assignee:bob', $userSession->getFilters(2));
}
public function testListOrder()
{
$userSession = new UserSession($this->container);
list($order, $direction) = $userSession->getListOrder(1);
$this->assertEquals('tasks.id', $order);
$this->assertEquals('DESC', $direction);
$userSession->setListOrder(1, 'tasks.priority', 'ASC');
list($order, $direction) = $userSession->getListOrder(1);
$this->assertEquals('tasks.priority', $order);
$this->assertEquals('ASC', $direction);
list($order, $direction) = $userSession->getListOrder(2);
$this->assertEquals('tasks.id', $order);
$this->assertEquals('DESC', $direction);
$userSession->setListOrder(2, 'tasks.is_active', 'DESC');
list($order, $direction) = $userSession->getListOrder(2);
$this->assertEquals('tasks.is_active', $order);
$this->assertEquals('DESC', $direction);
}
public function testPostAuthentication()
{
$userSession = new UserSession($this->container);