feat: add integration test for transferring board ownership with data
Signed-off-by: Luka Trovic <luka@nextcloud.com>
This commit is contained in:
committed by
Julius Härtl
parent
4615926e3b
commit
e4551bde15
@@ -6,6 +6,7 @@ use OCA\Deck\Db\Acl;
|
||||
use OCA\Deck\Db\Assignment;
|
||||
use OCA\Deck\Db\AssignmentMapper;
|
||||
use OCA\Deck\Db\Board;
|
||||
use OCA\Deck\Db\Card;
|
||||
|
||||
/**
|
||||
* @group DB
|
||||
@@ -88,6 +89,25 @@ class TransferOwnershipTest extends \Test\TestCase {
|
||||
$this->assertEquals(self::TEST_USER_2, $boardOwner);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::transferOwnership
|
||||
*/
|
||||
public function testTransferBoardOwnershipWithData()
|
||||
{
|
||||
$this->boardService->transferOwnership(self::TEST_USER_1, self::TEST_USER_2);
|
||||
$board = $this->boardService->find($this->board->getId());
|
||||
|
||||
$boardOwner = $board->getOwner();
|
||||
$this->assertEquals(self::TEST_USER_2, $boardOwner);
|
||||
|
||||
$cards = $this->cards;
|
||||
$newOwnerOwnsTheCards = (bool)array_product(array_filter($cards, function (Card $card) {
|
||||
$cardUpdated = $this->cardService->find($card->getId());
|
||||
return $cardUpdated->getOwner() === self::TEST_USER_2;
|
||||
}));
|
||||
$this->assertTrue($newOwnerOwnsTheCards);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::transferOwnership
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user