@@ -290,7 +290,7 @@ class DeckProvider implements IProvider {
|
||||
try {
|
||||
$comment = $this->commentsManager->get((int)$subjectParams['comment']);
|
||||
$event->setParsedMessage($comment->getMessage());
|
||||
$params['comment'] =[
|
||||
$params['comment'] = [
|
||||
'type' => 'highlight',
|
||||
'id' => $subjectParams['comment'],
|
||||
'name' => $comment->getMessage()
|
||||
|
||||
@@ -36,7 +36,7 @@ class CardDescriptionActivity extends Job {
|
||||
private $cardMapper;
|
||||
|
||||
public function __construct(ActivityManager $activityManager, CardMapper $cardMapper) {
|
||||
$this->activityManager = $activityManager;
|
||||
$this->activityManager = $activityManager;
|
||||
$this->cardMapper = $cardMapper;
|
||||
}
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ class Calendar extends ExternalCalendar {
|
||||
public function getProperties($properties) {
|
||||
return [
|
||||
'{DAV:}displayname' => 'Deck: ' . ($this->board ? $this->board->getTitle() : 'no board object provided'),
|
||||
'{http://apple.com/ns/ical/}calendar-color' => '#' . $this->board->getColor(),
|
||||
'{http://apple.com/ns/ical/}calendar-color' => '#' . $this->board->getColor(),
|
||||
'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VTODO']),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ class ChangeHelper {
|
||||
$time = time();
|
||||
$etag = md5($time . microtime());
|
||||
$this->cache->set(self::TYPE_BOARD . '-' . $boardId, $etag);
|
||||
$sql = 'UPDATE `*PREFIX*deck_boards` SET `last_modified` = ? WHERE `id` = ?';
|
||||
$sql = 'UPDATE `*PREFIX*deck_boards` SET `last_modified` = ? WHERE `id` = ?';
|
||||
$this->db->executeUpdate($sql, [$time, $boardId]);
|
||||
}
|
||||
|
||||
|
||||
@@ -389,7 +389,7 @@ trait BasicStructure {
|
||||
* @BeforeSuite
|
||||
*/
|
||||
public static function addFilesToSkeleton() {
|
||||
for ($i=0; $i<5; $i++) {
|
||||
for ($i = 0; $i < 5; $i++) {
|
||||
file_put_contents("../../core/skeleton/" . "textfile" . "$i" . ".txt", "Nextcloud test text file\n");
|
||||
}
|
||||
if (!file_exists("../../core/skeleton/FOLDER")) {
|
||||
@@ -409,7 +409,7 @@ trait BasicStructure {
|
||||
* @AfterSuite
|
||||
*/
|
||||
public static function removeFilesFromSkeleton() {
|
||||
for ($i=0; $i<5; $i++) {
|
||||
for ($i = 0; $i < 5; $i++) {
|
||||
self::removeFile("../../core/skeleton/", "textfile" . "$i" . ".txt");
|
||||
}
|
||||
if (is_dir("../../core/skeleton/FOLDER")) {
|
||||
|
||||
@@ -50,10 +50,10 @@ class UserExportTest extends \Test\TestCase {
|
||||
public function setUp(): void {
|
||||
parent::setUp();
|
||||
$this->boardMapper = $this->createMock(BoardMapper::class);
|
||||
$this->boardService= $this->createMock(BoardService::class);
|
||||
$this->stackMapper= $this->createMock(StackMapper::class);
|
||||
$this->cardMapper= $this->createMock(CardMapper::class);
|
||||
$this->assignedUserMapper= $this->createMock(AssignmentMapper::class);
|
||||
$this->boardService = $this->createMock(BoardService::class);
|
||||
$this->stackMapper = $this->createMock(StackMapper::class);
|
||||
$this->cardMapper = $this->createMock(CardMapper::class);
|
||||
$this->assignedUserMapper = $this->createMock(AssignmentMapper::class);
|
||||
$this->userManager = $this->createMock(IUserManager::class);
|
||||
$this->groupManager = $this->createMock(IGroupManager::class);
|
||||
$this->userExport = new UserExport($this->boardMapper, $this->boardService, $this->stackMapper, $this->cardMapper, $this->assignedUserMapper, $this->userManager, $this->groupManager);
|
||||
@@ -104,13 +104,13 @@ class UserExportTest extends \Test\TestCase {
|
||||
$this->getCard(2),
|
||||
$this->getCard(3),
|
||||
];
|
||||
$this->cardMapper->expects($this->exactly(count($boards)*count($stacks)))
|
||||
$this->cardMapper->expects($this->exactly(count($boards) * count($stacks)))
|
||||
->method('findAllByStack')
|
||||
->willReturn($cards);
|
||||
$this->cardMapper->expects($this->exactly(count($boards)*count($stacks)*count($cards)))
|
||||
$this->cardMapper->expects($this->exactly(count($boards) * count($stacks) * count($cards)))
|
||||
->method('find')
|
||||
->willReturn($cards[0]);
|
||||
$this->assignedUserMapper->expects($this->exactly(count($boards)*count($stacks)*count($cards)))
|
||||
$this->assignedUserMapper->expects($this->exactly(count($boards) * count($stacks) * count($cards)))
|
||||
->method('find')
|
||||
->willReturn([]);
|
||||
$result = $this->invokePrivate($this->userExport, 'execute', [$input, $output]);
|
||||
|
||||
@@ -74,7 +74,7 @@ class AclMapperTest extends MapperTestUtility {
|
||||
}
|
||||
}
|
||||
/** @return Acl */
|
||||
public function getAcl($type='user', $participant='admin', $edit=false, $share=false, $manage=false, $boardId=123) {
|
||||
public function getAcl($type = 'user', $participant = 'admin', $edit = false, $share = false, $manage = false, $boardId = 123) {
|
||||
$acl = new Acl();
|
||||
$acl->setParticipant($participant);
|
||||
$acl->setType('user');
|
||||
|
||||
@@ -86,7 +86,7 @@ class BoardMapperTest extends MapperTestUtility {
|
||||
}
|
||||
}
|
||||
/** @return Acl */
|
||||
public function getAcl($type='user', $participant='admin', $edit=false, $share=false, $manage=false, $boardId=123) {
|
||||
public function getAcl($type = 'user', $participant = 'admin', $edit = false, $share = false, $manage = false, $boardId = 123) {
|
||||
$acl = new Acl();
|
||||
$acl->setParticipant($participant);
|
||||
$acl->setType('user');
|
||||
|
||||
@@ -36,7 +36,7 @@ class RelationalEntityTest extends \Test\TestCase {
|
||||
$entity = new RelationalEntity();
|
||||
$entity->foo = null;
|
||||
$entity->setFoo('test');
|
||||
$this->assertEquals(['foo'=>true], $entity->getUpdatedFields());
|
||||
$this->assertEquals(['foo' => true], $entity->getUpdatedFields());
|
||||
}
|
||||
|
||||
public function testJsonSerialize() {
|
||||
|
||||
@@ -109,7 +109,7 @@ class UnknownUserTest extends \Test\TestCase {
|
||||
|
||||
|
||||
/** @return Acl */
|
||||
public function getAcl($type=Acl::PERMISSION_TYPE_USER, $participant='admin', $boardId=123) {
|
||||
public function getAcl($type = Acl::PERMISSION_TYPE_USER, $participant = 'admin', $boardId = 123) {
|
||||
$acl = new Acl();
|
||||
$acl->setParticipant($participant);
|
||||
$acl->setType($type);
|
||||
|
||||
@@ -246,7 +246,7 @@ class CardServiceTest extends TestCase {
|
||||
|
||||
private function getCards() {
|
||||
$cards = [];
|
||||
for ($i=0; $i<10; $i++) {
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
$cards[$i] = new Card();
|
||||
$cards[$i]->setTitle($i);
|
||||
$cards[$i]->setOrder($i);
|
||||
|
||||
@@ -216,7 +216,7 @@ class PermissionServiceTest extends \Test\TestCase {
|
||||
}
|
||||
|
||||
/** @dataProvider dataCheckPermission */
|
||||
public function testCheckPermission($boardId, $permission, $result, $owner='foo') {
|
||||
public function testCheckPermission($boardId, $permission, $result, $owner = 'foo') {
|
||||
// Setup mapper
|
||||
$mapper = $this->getMockBuilder(IPermissionMapper::class)->getMock();
|
||||
|
||||
@@ -245,7 +245,7 @@ class PermissionServiceTest extends \Test\TestCase {
|
||||
}
|
||||
|
||||
/** @dataProvider dataCheckPermission */
|
||||
public function testCheckPermissionWithoutMapper($boardId, $permission, $result, $owner='foo') {
|
||||
public function testCheckPermissionWithoutMapper($boardId, $permission, $result, $owner = 'foo') {
|
||||
$mapper = null;
|
||||
$board = new Board();
|
||||
$board->setId($boardId);
|
||||
|
||||
@@ -116,8 +116,8 @@ class StackServiceTest extends TestCase {
|
||||
|
||||
|
||||
$actual = $this->stackService->findAll(123);
|
||||
for ($stackId=0; $stackId<3; $stackId++) {
|
||||
for ($cardId=0;$cardId<10;$cardId++) {
|
||||
for ($stackId = 0; $stackId < 3; $stackId++) {
|
||||
for ($cardId = 0;$cardId < 10;$cardId++) {
|
||||
$this->assertEquals($actual[0]->getCards()[$cardId]->getId(), $cardId);
|
||||
$this->assertEquals($actual[0]->getCards()[$cardId]->getStackId(), 222);
|
||||
$this->assertEquals($actual[0]->getCards()[$cardId]->getLabels(), $this->getLabels()[$cardId]);
|
||||
@@ -132,8 +132,8 @@ class StackServiceTest extends TestCase {
|
||||
$this->cardMapper->expects($this->any())->method('findAllArchived')->willReturn($this->getCards(222));
|
||||
|
||||
$actual = $this->stackService->findAllArchived(123);
|
||||
for ($stackId=0; $stackId<3; $stackId++) {
|
||||
for ($cardId=0;$cardId<10;$cardId++) {
|
||||
for ($stackId = 0; $stackId < 3; $stackId++) {
|
||||
for ($cardId = 0;$cardId < 10;$cardId++) {
|
||||
$this->assertEquals($actual[0]->getCards()[$cardId]->getId(), $cardId);
|
||||
$this->assertEquals($actual[0]->getCards()[$cardId]->getStackId(), 222);
|
||||
$this->assertEquals($actual[0]->getCards()[$cardId]->getLabels(), $this->getLabels()[$cardId]);
|
||||
@@ -142,7 +142,7 @@ class StackServiceTest extends TestCase {
|
||||
}
|
||||
|
||||
private function getLabels() {
|
||||
for ($i=0;$i<10;$i++) {
|
||||
for ($i = 0;$i < 10;$i++) {
|
||||
$label1 = new Label();
|
||||
$label1->setTitle('Important');
|
||||
$label1->setCardId(1);
|
||||
@@ -165,9 +165,9 @@ class StackServiceTest extends TestCase {
|
||||
$s1->setBoardId(1);
|
||||
return [$s1, $s2];
|
||||
}
|
||||
private function getCards($stackId=0) {
|
||||
private function getCards($stackId = 0) {
|
||||
$cards = [];
|
||||
for ($i=0;$i<10;$i++) {
|
||||
for ($i = 0;$i < 10;$i++) {
|
||||
$cards[$i] = new Card();
|
||||
$cards[$i]->setId($i);
|
||||
$cards[$i]->setStackId($stackId);
|
||||
|
||||
Reference in New Issue
Block a user