diff options
author | Joas Schilling <coding@schilljs.com> | 2022-05-03 07:20:46 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-05-03 12:51:23 +0200 |
commit | 6e4d721278e886710032a132e2df50626836be7a (patch) | |
tree | 1ea32587074d546a3e6271eee7af50f00d1100d9 /tests/Core | |
parent | fc826e98115b510313ddacbf6fef4ce8d041e373 (diff) | |
download | nextcloud-server-6e4d721278e886710032a132e2df50626836be7a.tar.gz nextcloud-server-6e4d721278e886710032a132e2df50626836be7a.zip |
Expose shareWithDisplayNameUnique also on autocomplete endpoint
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/Core')
-rw-r--r-- | tests/Core/Controller/AutoCompleteControllerTest.php | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/tests/Core/Controller/AutoCompleteControllerTest.php b/tests/Core/Controller/AutoCompleteControllerTest.php index 61fc90e3c82..0775fbbd818 100644 --- a/tests/Core/Controller/AutoCompleteControllerTest.php +++ b/tests/Core/Controller/AutoCompleteControllerTest.php @@ -75,8 +75,8 @@ class AutoCompleteControllerTest extends TestCase { ], // expected [ - [ 'id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => ''], - [ 'id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => ''], + [ 'id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''], + [ 'id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''], ], '', 'files', @@ -96,8 +96,8 @@ class AutoCompleteControllerTest extends TestCase { ], // expected [ - [ 'id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => ''], - [ 'id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => ''], + [ 'id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''], + [ 'id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''], ], '', null, @@ -117,8 +117,8 @@ class AutoCompleteControllerTest extends TestCase { ], // expected [ - [ 'id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => ''], - [ 'id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => ''], + [ 'id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''], + [ 'id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''], ], '', 'files', @@ -138,14 +138,35 @@ class AutoCompleteControllerTest extends TestCase { ], ], [ - [ 'id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => ''], - [ 'id' => 'bobby', 'label' => 'Robert R.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => ''], + [ 'id' => 'bob', 'label' => 'Bob Y.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''], + [ 'id' => 'bobby', 'label' => 'Robert R.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => ''], ], 'bob', 'files', '42', null - ] + ], + [ #4 – with unique name + [ + 'exact' => [ + 'users' => [], + 'robots' => [], + ], + 'users' => [ + ['label' => 'Alice A.', 'value' => ['shareWith' => 'alice'], 'shareWithDisplayNameUnique' => 'alica@nextcloud.com'], + ['label' => 'Alice A.', 'value' => ['shareWith' => 'alicea'], 'shareWithDisplayNameUnique' => 'alicaa@nextcloud.com'], + ], + ], + // expected + [ + [ 'id' => 'alice', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => 'alica@nextcloud.com'], + [ 'id' => 'alicea', 'label' => 'Alice A.', 'icon' => '', 'source' => 'users', 'status' => '', 'subline' => '', 'shareWithDisplayNameUnique' => 'alicaa@nextcloud.com'], + ], + '', + 'files', + '42', + 'karma|bus-factor' + ], ]; } |