diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-12-01 13:29:20 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2016-01-20 16:30:22 +0100 |
commit | 222e719c8760871376327c1f353fe725b430614c (patch) | |
tree | f5fc0048b06d4f92f9f4fb1a929e2e68abdcd95e /tests/lib/files | |
parent | fd37e72ee929ab1ee869a20fe897bd69333d5aae (diff) | |
download | nextcloud-server-222e719c8760871376327c1f353fe725b430614c.tar.gz nextcloud-server-222e719c8760871376327c1f353fe725b430614c.zip |
sort in tests
Diffstat (limited to 'tests/lib/files')
-rw-r--r-- | tests/lib/files/config/usermountcache.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/lib/files/config/usermountcache.php b/tests/lib/files/config/usermountcache.php index 3d147fbc7a9..cc7686af536 100644 --- a/tests/lib/files/config/usermountcache.php +++ b/tests/lib/files/config/usermountcache.php @@ -10,13 +10,24 @@ namespace Test\Files\Config; use OC\Files\Mount\MountPoint; use OC\Files\Storage\Temporary; +use OC\Log; use OC\User\Manager; +use OCP\Files\Config\ICachedMountInfo; use OCP\IDBConnection; use OCP\IUserManager; -use Test\NullLogger; use Test\TestCase; use Test\Util\User\Dummy; +class NullLogger extends Log { + public function __construct($logger = null) { + //disable original constructor + } + + public function log($level, $message, array $context = array()) { + //noop + } +} + /** * @group DB */ @@ -207,6 +218,9 @@ class UserMountCache extends TestCase { $this->clearCache(); $cachedMounts = $this->cache->getMountsForStorageId(3); + usort($cachedMounts, function (ICachedMountInfo $a, ICachedMountInfo $b) { + return strcmp($a->getUser()->getUID(), $b->getUser()->getUID()); + }); $this->assertCount(2, $cachedMounts); @@ -234,6 +248,9 @@ class UserMountCache extends TestCase { $this->clearCache(); $cachedMounts = $this->cache->getMountsForRootId(4); + usort($cachedMounts, function (ICachedMountInfo $a, ICachedMountInfo $b) { + return strcmp($a->getUser()->getUID(), $b->getUser()->getUID()); + }); $this->assertCount(2, $cachedMounts); |