Expose etag through JSON responses for child elements

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2020-11-10 17:15:05 +01:00
parent 6a8e607134
commit a46d31caf2
10 changed files with 35 additions and 9 deletions

View File

@@ -33,7 +33,7 @@ class StackTest extends \Test\TestCase {
return $board;
}
public function testJsonSerialize() {
$board = $this->createStack();
$stack = $this->createStack();
$this->assertEquals([
'id' => 1,
'title' => "My Stack",
@@ -41,12 +41,13 @@ class StackTest extends \Test\TestCase {
'boardId' => 1,
'deletedAt' => 0,
'lastModified' => 0,
], $board->jsonSerialize());
'ETag' => $stack->getETag(),
], $stack->jsonSerialize());
}
public function testJsonSerializeWithCards() {
$cards = ["foo", "bar"];
$board = $this->createStack();
$board->setCards($cards);
$stack = $this->createStack();
$stack->setCards($cards);
$this->assertEquals([
'id' => 1,
'title' => "My Stack",
@@ -55,6 +56,7 @@ class StackTest extends \Test\TestCase {
'cards' => ["foo", "bar"],
'deletedAt' => 0,
'lastModified' => 0,
], $board->jsonSerialize());
'ETag' => $stack->getETag(),
], $stack->jsonSerialize());
}
}