|
|
|
@ -1,4 +1,5 @@ |
|
|
|
|
<?php |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors |
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later |
|
|
|
@ -60,32 +61,30 @@ class CommentersSorterTest extends TestCase { |
|
|
|
|
#1 – sort properly and otherwise keep existing order |
|
|
|
|
'actors' => ['users' => ['celia' => 3, 'darius' => 7, 'faruk' => 5, 'gail' => 5], 'bots' => ['r2-d2' => 8]], |
|
|
|
|
'input' => [ |
|
|
|
|
'users' => |
|
|
|
|
[ |
|
|
|
|
['value' => ['shareWith' => 'alice']], |
|
|
|
|
['value' => ['shareWith' => 'bob']], |
|
|
|
|
['value' => ['shareWith' => 'celia']], |
|
|
|
|
['value' => ['shareWith' => 'darius']], |
|
|
|
|
['value' => ['shareWith' => 'elena']], |
|
|
|
|
['value' => ['shareWith' => 'faruk']], |
|
|
|
|
['value' => ['shareWith' => 'gail']], |
|
|
|
|
], |
|
|
|
|
'users' => [ |
|
|
|
|
['value' => ['shareWith' => 'alice']], |
|
|
|
|
['value' => ['shareWith' => 'bob']], |
|
|
|
|
['value' => ['shareWith' => 'celia']], |
|
|
|
|
['value' => ['shareWith' => 'darius']], |
|
|
|
|
['value' => ['shareWith' => 'elena']], |
|
|
|
|
['value' => ['shareWith' => 'faruk']], |
|
|
|
|
['value' => ['shareWith' => 'gail']], |
|
|
|
|
], |
|
|
|
|
'bots' => [ |
|
|
|
|
['value' => ['shareWith' => 'c-3po']], |
|
|
|
|
['value' => ['shareWith' => 'r2-d2']], |
|
|
|
|
] |
|
|
|
|
], |
|
|
|
|
'expected' => [ |
|
|
|
|
'users' => |
|
|
|
|
[ |
|
|
|
|
['value' => ['shareWith' => 'darius']], |
|
|
|
|
['value' => ['shareWith' => 'faruk']], |
|
|
|
|
['value' => ['shareWith' => 'gail']], |
|
|
|
|
['value' => ['shareWith' => 'celia']], |
|
|
|
|
['value' => ['shareWith' => 'alice']], |
|
|
|
|
['value' => ['shareWith' => 'bob']], |
|
|
|
|
['value' => ['shareWith' => 'elena']], |
|
|
|
|
], |
|
|
|
|
'users' => [ |
|
|
|
|
['value' => ['shareWith' => 'darius']], |
|
|
|
|
['value' => ['shareWith' => 'faruk']], |
|
|
|
|
['value' => ['shareWith' => 'gail']], |
|
|
|
|
['value' => ['shareWith' => 'celia']], |
|
|
|
|
['value' => ['shareWith' => 'alice']], |
|
|
|
|
['value' => ['shareWith' => 'bob']], |
|
|
|
|
['value' => ['shareWith' => 'elena']], |
|
|
|
|
], |
|
|
|
|
'bots' => [ |
|
|
|
|
['value' => ['shareWith' => 'r2-d2']], |
|
|
|
|
['value' => ['shareWith' => 'c-3po']], |
|
|
|
@ -96,32 +95,30 @@ class CommentersSorterTest extends TestCase { |
|
|
|
|
#2 – no commentors, input equals output |
|
|
|
|
'actors' => [], |
|
|
|
|
'input' => [ |
|
|
|
|
'users' => |
|
|
|
|
[ |
|
|
|
|
['value' => ['shareWith' => 'alice']], |
|
|
|
|
['value' => ['shareWith' => 'bob']], |
|
|
|
|
['value' => ['shareWith' => 'celia']], |
|
|
|
|
['value' => ['shareWith' => 'darius']], |
|
|
|
|
['value' => ['shareWith' => 'elena']], |
|
|
|
|
['value' => ['shareWith' => 'faruk']], |
|
|
|
|
['value' => ['shareWith' => 'gail']], |
|
|
|
|
], |
|
|
|
|
'users' => [ |
|
|
|
|
['value' => ['shareWith' => 'alice']], |
|
|
|
|
['value' => ['shareWith' => 'bob']], |
|
|
|
|
['value' => ['shareWith' => 'celia']], |
|
|
|
|
['value' => ['shareWith' => 'darius']], |
|
|
|
|
['value' => ['shareWith' => 'elena']], |
|
|
|
|
['value' => ['shareWith' => 'faruk']], |
|
|
|
|
['value' => ['shareWith' => 'gail']], |
|
|
|
|
], |
|
|
|
|
'bots' => [ |
|
|
|
|
['value' => ['shareWith' => 'c-3po']], |
|
|
|
|
['value' => ['shareWith' => 'r2-d2']], |
|
|
|
|
] |
|
|
|
|
], |
|
|
|
|
'expected' => [ |
|
|
|
|
'users' => |
|
|
|
|
[ |
|
|
|
|
['value' => ['shareWith' => 'alice']], |
|
|
|
|
['value' => ['shareWith' => 'bob']], |
|
|
|
|
['value' => ['shareWith' => 'celia']], |
|
|
|
|
['value' => ['shareWith' => 'darius']], |
|
|
|
|
['value' => ['shareWith' => 'elena']], |
|
|
|
|
['value' => ['shareWith' => 'faruk']], |
|
|
|
|
['value' => ['shareWith' => 'gail']], |
|
|
|
|
], |
|
|
|
|
'users' => [ |
|
|
|
|
['value' => ['shareWith' => 'alice']], |
|
|
|
|
['value' => ['shareWith' => 'bob']], |
|
|
|
|
['value' => ['shareWith' => 'celia']], |
|
|
|
|
['value' => ['shareWith' => 'darius']], |
|
|
|
|
['value' => ['shareWith' => 'elena']], |
|
|
|
|
['value' => ['shareWith' => 'faruk']], |
|
|
|
|
['value' => ['shareWith' => 'gail']], |
|
|
|
|
], |
|
|
|
|
'bots' => [ |
|
|
|
|
['value' => ['shareWith' => 'c-3po']], |
|
|
|
|
['value' => ['shareWith' => 'r2-d2']], |
|
|
|
|