Tests: Fix tests for user assignment

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2017-10-03 23:42:20 +02:00
committed by Julius Härtl
parent 99c31d3c00
commit 28d6f4196e
4 changed files with 59 additions and 21 deletions

View File

@@ -77,6 +77,7 @@ class CardTest extends \PHPUnit_Framework_TestCase {
'duedate' => null,
'overdue' => 0,
'archived' => false,
'assignedUsers' => null,
], $card->jsonSerialize());
}
public function testJsonSerializeLabels() {
@@ -106,4 +107,27 @@ class CardTest extends \PHPUnit_Framework_TestCase {
$card->setDatabaseType('mysql');
$this->assertEquals($date->format('Y-m-d H:i:s'), $card->getDuedate(false));
}
public function testJsonSerializeAsignedUsers() {
$card = $this->createCard();
$card->setAssignedUsers([ 'user1' ]);
$card->setLabels(array());
$this->assertEquals([
'id' => 1,
'title' => "My Card",
'description' => "a long description",
'type' => 'text',
'lastModified' => 234,
'createdAt' => 123,
'owner' => 'admin',
'order' => 12,
'stackId' => 1,
'labels' => array(),
'duedate' => null,
'overdue' => 0,
'archived' => false,
'assignedUsers' => ['user1'],
], $card->jsonSerialize());
}
}