summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Collaboration/Collaborators/UserPluginTest.php76
-rw-r--r--tests/lib/DB/MigratorTest.php53
-rw-r--r--tests/lib/Files/Cache/Wrapper/CacheJailTest.php70
-rw-r--r--tests/lib/RepairStepTest.php3
-rw-r--r--tests/lib/Share20/LegacyHooksTest.php19
-rw-r--r--tests/lib/Share20/ManagerTest.php80
6 files changed, 191 insertions, 110 deletions
diff --git a/tests/lib/Collaboration/Collaborators/UserPluginTest.php b/tests/lib/Collaboration/Collaborators/UserPluginTest.php
index f2e0e7e274b..acbcd42f04f 100644
--- a/tests/lib/Collaboration/Collaborators/UserPluginTest.php
+++ b/tests/lib/Collaboration/Collaborators/UserPluginTest.php
@@ -104,17 +104,19 @@ class UserPluginTest extends TestCase {
);
}
- public function mockConfig($shareWithGroupOnly, $shareeEnumeration, $shareeEnumerationLimitToGroup) {
+ public function mockConfig($shareWithGroupOnly, $shareeEnumeration, $shareeEnumerationLimitToGroup, $shareeEnumerationPhone = false) {
$this->config->expects($this->any())
->method('getAppValue')
->willReturnCallback(
- function ($appName, $key, $default) use ($shareWithGroupOnly, $shareeEnumeration, $shareeEnumerationLimitToGroup) {
+ function ($appName, $key, $default) use ($shareWithGroupOnly, $shareeEnumeration, $shareeEnumerationLimitToGroup, $shareeEnumerationPhone) {
if ($appName === 'core' && $key === 'shareapi_only_share_with_group_members') {
return $shareWithGroupOnly ? 'yes' : 'no';
} elseif ($appName === 'core' && $key === 'shareapi_allow_share_dialog_user_enumeration') {
return $shareeEnumeration ? 'yes' : 'no';
} elseif ($appName === 'core' && $key === 'shareapi_restrict_user_enumeration_to_group') {
return $shareeEnumerationLimitToGroup ? 'yes' : 'no';
+ } elseif ($appName === 'core' && $key === 'shareapi_restrict_user_enumeration_to_phone') {
+ return $shareeEnumerationPhone ? 'yes' : 'no';
}
return $default;
}
@@ -269,6 +271,28 @@ class UserPluginTest extends TestCase {
[
'test',
false,
+ true,
+ [],
+ [
+ $this->getUserMock('test0', 'Test'),
+ $this->getUserMock('test1', 'Test One'),
+ $this->getUserMock('test2', 'Test Two'),
+ ],
+ [
+ ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test0'], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => 'test0'],
+ ],
+ [
+ ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => 'test1'],
+ ['label' => 'Test Two', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test2'], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => 'test2'],
+ ],
+ false,
+ false,
+ [],
+ true,
+ ],
+ [
+ 'test',
+ false,
false,
[],
[
@@ -443,9 +467,10 @@ class UserPluginTest extends TestCase {
array $expected,
$reachedEnd,
$singleUser,
- array $users = []
+ array $users = [],
+ $shareeEnumerationPhone = false
) {
- $this->mockConfig($shareWithGroupOnly, $shareeEnumeration, false);
+ $this->mockConfig($shareWithGroupOnly, $shareeEnumeration, false, $shareeEnumerationPhone);
$this->instantiatePlugin();
$this->session->expects($this->any())
@@ -453,10 +478,24 @@ class UserPluginTest extends TestCase {
->willReturn($this->user);
if (!$shareWithGroupOnly) {
- $this->userManager->expects($this->once())
- ->method('searchDisplayName')
- ->with($searchTerm, $this->limit, $this->offset)
- ->willReturn($userResponse);
+ if ($shareeEnumerationPhone) {
+ $this->userManager->expects($this->once())
+ ->method('searchKnownUsersByDisplayName')
+ ->with($this->user->getUID(), $searchTerm, $this->limit, $this->offset)
+ ->willReturn($userResponse);
+
+ $this->knownUserService->method('isKnownToUser')
+ ->willReturnMap([
+ [$this->user->getUID(), 'test0', true],
+ [$this->user->getUID(), 'test1', true],
+ [$this->user->getUID(), 'test2', true],
+ ]);
+ } else {
+ $this->userManager->expects($this->once())
+ ->method('searchDisplayName')
+ ->with($searchTerm, $this->limit, $this->offset)
+ ->willReturn($userResponse);
+ }
} else {
$this->groupManager->method('getUserGroupIds')
->with($this->user)
@@ -620,9 +659,10 @@ class UserPluginTest extends TestCase {
public function testSearchEnumerationLimit($search, $userGroups, $matchingUsers, $result) {
$this->mockConfig(false, true, true);
- $userResults = array_map(function ($user) {
- return $this->getUserMock($user['uid'], $user['uid']);
- }, $matchingUsers);
+ $userResults = [];
+ foreach ($matchingUsers as $user) {
+ $userResults[$user['uid']] = $user['uid'];
+ }
$mappedResultExact = array_map(function ($user) {
return ['label' => $user, 'value' => ['shareType' => 0, 'shareWith' => $user], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => $user];
@@ -631,9 +671,19 @@ class UserPluginTest extends TestCase {
return ['label' => $user, 'value' => ['shareType' => 0, 'shareWith' => $user], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => $user];
}, $result['wide']);
- $this->userManager->expects($this->once())
- ->method('searchDisplayName')
+ $this->userManager
+ ->method('get')
+ ->willReturnCallback(function ($userId) use ($userResults) {
+ if (isset($userResults[$userId])) {
+ return $this->getUserMock($userId, $userId);
+ }
+ return null;
+ });
+
+ $this->groupManager->method('displayNamesInGroup')
->willReturn($userResults);
+
+
$this->session->expects($this->any())
->method('getUser')
->willReturn($this->getUserMock('test', 'foo'));
diff --git a/tests/lib/DB/MigratorTest.php b/tests/lib/DB/MigratorTest.php
index 6b758534897..12ff3bd0749 100644
--- a/tests/lib/DB/MigratorTest.php
+++ b/tests/lib/DB/MigratorTest.php
@@ -15,7 +15,6 @@ use Doctrine\DBAL\Platforms\OraclePlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaConfig;
-use OC\DB\SchemaWrapper;
use OCP\IConfig;
/**
@@ -131,58 +130,6 @@ class MigratorTest extends \Test\TestCase {
return $this->connection->getDatabasePlatform() instanceof MySQLPlatform;
}
-
- public function testDuplicateKeyUpgrade() {
- $this->expectException(Exception\UniqueConstraintViolationException::class);
-
- if ($this->isSQLite()) {
- $this->markTestSkipped('sqlite does not throw errors when creating a new key on existing data');
- }
- [$startSchema, $endSchema] = $this->getDuplicateKeySchemas();
- $migrator = $this->manager->getMigrator();
- $migrator->migrate($startSchema);
-
- $this->connection->insert($this->tableName, ['id' => 1, 'name' => 'foo']);
- $this->connection->insert($this->tableName, ['id' => 2, 'name' => 'bar']);
- $this->connection->insert($this->tableName, ['id' => 2, 'name' => 'qwerty']);
-
- try {
- $migrator->migrate($endSchema);
- } catch (Exception\UniqueConstraintViolationException $e) {
- if (!$this->isMySQL()) {
- $this->connection->rollBack();
- }
- throw $e;
- }
- }
-
- public function testChangeToString() {
- [$startSchema, $endSchema] = $this->getChangedTypeSchema('integer', 'string');
- $migrator = $this->manager->getMigrator();
- $migrator->migrate($startSchema);
- $schema = new SchemaWrapper($this->connection);
- $table = $schema->getTable(substr($this->tableName, 3));
- $this->assertEquals('integer', $table->getColumn('id')->getType()->getName());
-
- $this->connection->insert($this->tableName, ['id' => 1, 'name' => 'foo']);
- $this->connection->insert($this->tableName, ['id' => 2, 'name' => 'bar']);
- $this->connection->insert($this->tableName, ['id' => 3, 'name' => 'qwerty']);
-
- $migrator->migrate($endSchema);
- $this->addToAssertionCount(1);
-
- $qb = $this->connection->getQueryBuilder();
- $result = $qb->select('*')->from(substr($this->tableName, 3))->execute();
- $this->assertEquals([
- ['id' => 1, 'name' => 'foo'],
- ['id' => 2, 'name' => 'bar'],
- ['id' => 3, 'name' => 'qwerty']
- ], $result->fetchAll());
- $schema = new SchemaWrapper($this->connection);
- $table = $schema->getTable(substr($this->tableName, 3));
- $this->assertEquals('string', $table->getColumn('id')->getType()->getName());
- }
-
public function testUpgrade() {
[$startSchema, $endSchema] = $this->getDuplicateKeySchemas();
$migrator = $this->manager->getMigrator();
diff --git a/tests/lib/Files/Cache/Wrapper/CacheJailTest.php b/tests/lib/Files/Cache/Wrapper/CacheJailTest.php
index f0943ba5a03..d9f7af1f034 100644
--- a/tests/lib/Files/Cache/Wrapper/CacheJailTest.php
+++ b/tests/lib/Files/Cache/Wrapper/CacheJailTest.php
@@ -9,6 +9,11 @@
namespace Test\Files\Cache\Wrapper;
use OC\Files\Cache\Wrapper\CacheJail;
+use OC\Files\Search\SearchComparison;
+use OC\Files\Search\SearchQuery;
+use OC\User\User;
+use OCP\Files\Search\ISearchComparison;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Test\Files\Cache\CacheTest;
/**
@@ -32,6 +37,7 @@ class CacheJailTest extends CacheTest {
}
public function testSearchOutsideJail() {
+ $this->storage->getScanner()->scan('');
$file1 = 'foo/foobar';
$file2 = 'folder/foobar';
$data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder'];
@@ -44,6 +50,52 @@ class CacheJailTest extends CacheTest {
$result = $this->cache->search('%foobar%');
$this->assertCount(1, $result);
$this->assertEquals('foobar', $result[0]['path']);
+
+ $result = $this->cache->search('%foo%');
+ $this->assertCount(2, $result);
+ usort($result, function ($a, $b) {
+ return $a['path'] <=> $b['path'];
+ });
+ $this->assertEquals('', $result[0]['path']);
+ $this->assertEquals('foobar', $result[1]['path']);
+ }
+
+ public function testSearchMimeOutsideJail() {
+ $this->storage->getScanner()->scan('');
+ $file1 = 'foo/foobar';
+ $file2 = 'folder/foobar';
+ $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder'];
+
+ $this->sourceCache->put($file1, $data1);
+ $this->sourceCache->put($file2, $data1);
+
+ $this->assertCount(2, $this->sourceCache->searchByMime('foo/folder'));
+
+ $result = $this->cache->search('%foobar%');
+ $this->assertCount(1, $result);
+ $this->assertEquals('foobar', $result[0]['path']);
+ }
+
+ public function testSearchQueryOutsideJail() {
+ $this->storage->getScanner()->scan('');
+ $file1 = 'foo/foobar';
+ $file2 = 'folder/foobar';
+ $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder'];
+
+ $this->sourceCache->put($file1, $data1);
+ $this->sourceCache->put($file2, $data1);
+
+ $user = new User('foo', null, $this->createMock(EventDispatcherInterface::class));
+ $query = new SearchQuery(new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'name', 'foobar'), 10, 0, [], $user);
+ $result = $this->cache->searchQuery($query);
+
+ $this->assertCount(1, $result);
+ $this->assertEquals('foobar', $result[0]['path']);
+
+ $query = new SearchQuery(new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'name', 'foo'), 10, 0, [], $user);
+ $result = $this->cache->searchQuery($query);
+ $this->assertCount(1, $result);
+ $this->assertEquals('', $result[0]['path']);
}
public function testClearKeepEntriesOutsideJail() {
@@ -130,4 +182,22 @@ class CacheJailTest extends CacheTest {
$this->assertTrue($this->sourceCache->inCache('target/foo'));
$this->assertTrue($this->sourceCache->inCache('target/foo/bar'));
}
+
+ public function testSearchNested() {
+ $this->storage->getScanner()->scan('');
+ $file1 = 'foo';
+ $file2 = 'foo/bar';
+ $file3 = 'foo/bar/asd';
+ $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder'];
+
+ $this->sourceCache->put($file1, $data1);
+ $this->sourceCache->put($file2, $data1);
+ $this->sourceCache->put($file3, $data1);
+
+ $nested = new \OC\Files\Cache\Wrapper\CacheJail($this->cache, 'bar');
+
+ $result = $nested->search('%asd%');
+ $this->assertCount(1, $result);
+ $this->assertEquals('asd', $result[0]['path']);
+ }
}
diff --git a/tests/lib/RepairStepTest.php b/tests/lib/RepairStepTest.php
index 9a569f8af6d..b1d16fdd3fd 100644
--- a/tests/lib/RepairStepTest.php
+++ b/tests/lib/RepairStepTest.php
@@ -9,6 +9,7 @@
namespace Test;
use OCP\Migration\IRepairStep;
+use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcher;
class RepairStepTest implements IRepairStep {
@@ -41,7 +42,7 @@ class RepairTest extends TestCase {
protected function setUp(): void {
parent::setUp();
$dispatcher = new EventDispatcher();
- $this->repair = new \OC\Repair([], $dispatcher);
+ $this->repair = new \OC\Repair([], $dispatcher, $this->createMock(LoggerInterface::class));
$dispatcher->addListener('\OC\Repair::warning', function ($event) {
/** @var \Symfony\Component\EventDispatcher\GenericEvent $event */
diff --git a/tests/lib/Share20/LegacyHooksTest.php b/tests/lib/Share20/LegacyHooksTest.php
index 66dbafe7691..a615e26afb0 100644
--- a/tests/lib/Share20/LegacyHooksTest.php
+++ b/tests/lib/Share20/LegacyHooksTest.php
@@ -26,6 +26,7 @@ namespace Test\Share20;
use OC\Share20\LegacyHooks;
use OC\Share20\Manager;
use OCP\Constants;
+use OCP\Files\Cache\ICacheEntry;
use OCP\Files\File;
use OCP\Share\IShare;
use Symfony\Component\EventDispatcher\EventDispatcher;
@@ -55,6 +56,9 @@ class LegacyHooksTest extends TestCase {
$path = $this->createMock(File::class);
$path->method('getId')->willReturn(1);
+ $info = $this->createMock(ICacheEntry::class);
+ $info->method('getMimeType')->willReturn('text/plain');
+
$share = $this->manager->newShare();
$share->setId(42)
->setProviderId('prov')
@@ -62,7 +66,8 @@ class LegacyHooksTest extends TestCase {
->setSharedWith('awesomeUser')
->setSharedBy('sharedBy')
->setNode($path)
- ->setTarget('myTarget');
+ ->setTarget('myTarget')
+ ->setNodeCacheEntry($info);
$hookListner = $this->getMockBuilder('Dummy')->setMethods(['pre'])->getMock();
\OCP\Util::connectHook('OCP\Share', 'pre_unshare', $hookListner, 'pre');
@@ -92,6 +97,9 @@ class LegacyHooksTest extends TestCase {
$path = $this->createMock(File::class);
$path->method('getId')->willReturn(1);
+ $info = $this->createMock(ICacheEntry::class);
+ $info->method('getMimeType')->willReturn('text/plain');
+
$share = $this->manager->newShare();
$share->setId(42)
->setProviderId('prov')
@@ -99,7 +107,8 @@ class LegacyHooksTest extends TestCase {
->setSharedWith('awesomeUser')
->setSharedBy('sharedBy')
->setNode($path)
- ->setTarget('myTarget');
+ ->setTarget('myTarget')
+ ->setNodeCacheEntry($info);
$hookListner = $this->getMockBuilder('Dummy')->setMethods(['post'])->getMock();
\OCP\Util::connectHook('OCP\Share', 'post_unshare', $hookListner, 'post');
@@ -143,6 +152,9 @@ class LegacyHooksTest extends TestCase {
$path = $this->createMock(File::class);
$path->method('getId')->willReturn(1);
+ $info = $this->createMock(ICacheEntry::class);
+ $info->method('getMimeType')->willReturn('text/plain');
+
$share = $this->manager->newShare();
$share->setId(42)
->setProviderId('prov')
@@ -150,7 +162,8 @@ class LegacyHooksTest extends TestCase {
->setSharedWith('awesomeUser')
->setSharedBy('sharedBy')
->setNode($path)
- ->setTarget('myTarget');
+ ->setTarget('myTarget')
+ ->setNodeCacheEntry($info);
$hookListner = $this->getMockBuilder('Dummy')->setMethods(['postFromSelf'])->getMock();
\OCP\Util::connectHook('OCP\Share', 'post_unshareFromSelf', $hookListner, 'postFromSelf');
diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php
index e6042ca8445..c70887ec87d 100644
--- a/tests/lib/Share20/ManagerTest.php
+++ b/tests/lib/Share20/ManagerTest.php
@@ -1068,7 +1068,7 @@ class ManagerTest extends \Test\TestCase {
$share = $this->manager->newShare();
$share->setExpirationDate($past);
- self::invokePrivate($this->manager, 'validateExpirationDate', [$share]);
+ self::invokePrivate($this->manager, 'validateExpirationDateLink', [$share]);
}
public function testValidateExpirationDateEnforceButNotSet() {
@@ -1084,7 +1084,7 @@ class ManagerTest extends \Test\TestCase {
['core', 'shareapi_enforce_expire_date', 'no', 'yes'],
]);
- self::invokePrivate($this->manager, 'validateExpirationDate', [$share]);
+ self::invokePrivate($this->manager, 'validateExpirationDateLink', [$share]);
}
public function testValidateExpirationDateEnforceButNotEnabledAndNotSet() {
@@ -1096,7 +1096,7 @@ class ManagerTest extends \Test\TestCase {
['core', 'shareapi_enforce_expire_date', 'no', 'yes'],
]);
- self::invokePrivate($this->manager, 'validateExpirationDate', [$share]);
+ self::invokePrivate($this->manager, 'validateExpirationDateLink', [$share]);
$this->assertNull($share->getExpirationDate());
}
@@ -1116,7 +1116,7 @@ class ManagerTest extends \Test\TestCase {
$expected->setTime(0,0,0);
$expected->add(new \DateInterval('P3D'));
- self::invokePrivate($this->manager, 'validateExpirationDate', [$share]);
+ self::invokePrivate($this->manager, 'validateExpirationDateLink', [$share]);
$this->assertNotNull($share->getExpirationDate());
$this->assertEquals($expected, $share->getExpirationDate());
@@ -1137,7 +1137,7 @@ class ManagerTest extends \Test\TestCase {
$expected->setTime(0,0,0);
$expected->add(new \DateInterval('P1D'));
- self::invokePrivate($this->manager, 'validateExpirationDate', [$share]);
+ self::invokePrivate($this->manager, 'validateExpirationDateLink', [$share]);
$this->assertNotNull($share->getExpirationDate());
$this->assertEquals($expected, $share->getExpirationDate());
@@ -1160,7 +1160,7 @@ class ManagerTest extends \Test\TestCase {
['core', 'shareapi_default_expire_date', 'no', 'yes'],
]);
- self::invokePrivate($this->manager, 'validateExpirationDate', [$share]);
+ self::invokePrivate($this->manager, 'validateExpirationDateLink', [$share]);
}
public function testValidateExpirationDateEnforceValid() {
@@ -1187,7 +1187,7 @@ class ManagerTest extends \Test\TestCase {
return $data['expirationDate'] == $future;
}));
- self::invokePrivate($this->manager, 'validateExpirationDate', [$share]);
+ self::invokePrivate($this->manager, 'validateExpirationDateLink', [$share]);
$this->assertEquals($expected, $share->getExpirationDate());
}
@@ -1209,7 +1209,7 @@ class ManagerTest extends \Test\TestCase {
return $data['expirationDate'] == $expected && $data['passwordSet'] === false;
}));
- self::invokePrivate($this->manager, 'validateExpirationDate', [$share]);
+ self::invokePrivate($this->manager, 'validateExpirationDateLink', [$share]);
$this->assertEquals($expected, $share->getExpirationDate());
}
@@ -1224,7 +1224,7 @@ class ManagerTest extends \Test\TestCase {
$share = $this->manager->newShare();
$share->setPassword('password');
- self::invokePrivate($this->manager, 'validateExpirationDate', [$share]);
+ self::invokePrivate($this->manager, 'validateExpirationDateLink', [$share]);
$this->assertNull($share->getExpirationDate());
}
@@ -1249,7 +1249,7 @@ class ManagerTest extends \Test\TestCase {
return $data['expirationDate'] == $expected;
}));
- self::invokePrivate($this->manager, 'validateExpirationDate', [$share]);
+ self::invokePrivate($this->manager, 'validateExpirationDateLink', [$share]);
$this->assertEquals($expected, $share->getExpirationDate());
}
@@ -1278,7 +1278,7 @@ class ManagerTest extends \Test\TestCase {
return $data['expirationDate'] == $expected;
}));
- self::invokePrivate($this->manager, 'validateExpirationDate', [$share]);
+ self::invokePrivate($this->manager, 'validateExpirationDateLink', [$share]);
$this->assertEquals($expected, $share->getExpirationDate());
}
@@ -1299,7 +1299,7 @@ class ManagerTest extends \Test\TestCase {
$share = $this->manager->newShare();
$share->setExpirationDate($nextWeek);
- self::invokePrivate($this->manager, 'validateExpirationDate', [$share]);
+ self::invokePrivate($this->manager, 'validateExpirationDateLink', [$share]);
$save->sub(new \DateInterval('P2D'));
$this->assertEquals($save, $share->getExpirationDate());
@@ -1323,7 +1323,7 @@ class ManagerTest extends \Test\TestCase {
$data['message'] = 'Invalid date!';
});
- self::invokePrivate($this->manager, 'validateExpirationDate', [$share]);
+ self::invokePrivate($this->manager, 'validateExpirationDateLink', [$share]);
}
public function testValidateExpirationDateExistingShareNoDefault() {
@@ -1337,7 +1337,7 @@ class ManagerTest extends \Test\TestCase {
['core', 'shareapi_expire_after_n_days', '7', '6'],
]);
- self::invokePrivate($this->manager, 'validateExpirationDate', [$share]);
+ self::invokePrivate($this->manager, 'validateExpirationDateLink', [$share]);
$this->assertEquals(null, $share->getExpirationDate());
}
@@ -2049,7 +2049,7 @@ class ManagerTest extends \Test\TestCase {
'generalCreateChecks',
'linkCreateChecks',
'pathCreateChecks',
- 'validateExpirationDate',
+ 'validateExpirationDateLink',
'verifyPassword',
'setLinkParent',
])
@@ -2091,7 +2091,7 @@ class ManagerTest extends \Test\TestCase {
->method('pathCreateChecks')
->with($path);
$manager->expects($this->once())
- ->method('validateExpirationDate')
+ ->method('validateExpirationDateLink')
->with($share)
->willReturn($share);
$manager->expects($this->once())
@@ -2174,7 +2174,7 @@ class ManagerTest extends \Test\TestCase {
'generalCreateChecks',
'linkCreateChecks',
'pathCreateChecks',
- 'validateExpirationDate',
+ 'validateExpirationDateLink',
'verifyPassword',
'setLinkParent',
])
@@ -2210,7 +2210,7 @@ class ManagerTest extends \Test\TestCase {
->method('pathCreateChecks')
->with($path);
$manager->expects($this->never())
- ->method('validateExpirationDate');
+ ->method('validateExpirationDateLink');
$manager->expects($this->never())
->method('verifyPassword');
$manager->expects($this->never())
@@ -3024,7 +3024,7 @@ class ManagerTest extends \Test\TestCase {
'linkCreateChecks',
'pathCreateChecks',
'verifyPassword',
- 'validateExpirationDate',
+ 'validateExpirationDateLink',
])
->getMock();
@@ -3053,7 +3053,7 @@ class ManagerTest extends \Test\TestCase {
$manager->expects($this->once())->method('canShare')->willReturn(true);
$manager->expects($this->once())->method('getShareById')->with('foo:42')->willReturn($originalShare);
- $manager->expects($this->once())->method('validateExpirationDate')->with($share);
+ $manager->expects($this->once())->method('validateExpirationDateLink')->with($share);
$manager->expects($this->once())->method('verifyPassword')->with('password');
$this->hasher->expects($this->once())
@@ -3105,7 +3105,7 @@ class ManagerTest extends \Test\TestCase {
'linkCreateChecks',
'pathCreateChecks',
'verifyPassword',
- 'validateExpirationDate',
+ 'validateExpirationDateLink',
])
->getMock();
@@ -3139,7 +3139,7 @@ class ManagerTest extends \Test\TestCase {
$manager->expects($this->once())->method('linkCreateChecks')->with($share);
$manager->expects($this->never())->method('verifyPassword');
$manager->expects($this->never())->method('pathCreateChecks');
- $manager->expects($this->never())->method('validateExpirationDate');
+ $manager->expects($this->never())->method('validateExpirationDateLink');
$this->hasher->expects($this->never())
->method('hash');
@@ -3171,7 +3171,7 @@ class ManagerTest extends \Test\TestCase {
'verifyPassword',
'pathCreateChecks',
'linkCreateChecks',
- 'validateExpirationDate',
+ 'validateExpirationDateLink',
])
->getMock();
@@ -3204,7 +3204,7 @@ class ManagerTest extends \Test\TestCase {
$manager->expects($this->once())->method('verifyPassword')->with('password');
$manager->expects($this->once())->method('pathCreateChecks')->with($file);
$manager->expects($this->never())->method('linkCreateChecks');
- $manager->expects($this->never())->method('validateExpirationDate');
+ $manager->expects($this->never())->method('validateExpirationDateLink');
$this->hasher->expects($this->once())
->method('hash')
@@ -3246,7 +3246,7 @@ class ManagerTest extends \Test\TestCase {
'verifyPassword',
'pathCreateChecks',
'linkCreateChecks',
- 'validateExpirationDate',
+ 'validateExpirationDateLink',
])
->getMock();
@@ -3282,7 +3282,7 @@ class ManagerTest extends \Test\TestCase {
$manager->expects($this->once())->method('verifyPassword')->with('password');
$manager->expects($this->once())->method('pathCreateChecks')->with($file);
$manager->expects($this->never())->method('linkCreateChecks');
- $manager->expects($this->never())->method('validateExpirationDate');
+ $manager->expects($this->never())->method('validateExpirationDateLink');
$this->hasher->expects($this->once())
->method('hash')
@@ -3324,7 +3324,7 @@ class ManagerTest extends \Test\TestCase {
'verifyPassword',
'pathCreateChecks',
'linkCreateChecks',
- 'validateExpirationDate',
+ 'validateExpirationDateLink',
])
->getMock();
@@ -3360,7 +3360,7 @@ class ManagerTest extends \Test\TestCase {
$manager->expects($this->once())->method('verifyPassword')->with('password');
$manager->expects($this->once())->method('pathCreateChecks')->with($file);
$manager->expects($this->never())->method('linkCreateChecks');
- $manager->expects($this->never())->method('validateExpirationDate');
+ $manager->expects($this->never())->method('validateExpirationDateLink');
$this->hasher->expects($this->once())
->method('verify')
@@ -3410,7 +3410,7 @@ class ManagerTest extends \Test\TestCase {
'verifyPassword',
'pathCreateChecks',
'linkCreateChecks',
- 'validateExpirationDate',
+ 'validateExpirationDateLink',
])
->getMock();
@@ -3446,7 +3446,7 @@ class ManagerTest extends \Test\TestCase {
$manager->expects($this->never())->method('verifyPassword');
$manager->expects($this->never())->method('pathCreateChecks');
$manager->expects($this->never())->method('linkCreateChecks');
- $manager->expects($this->never())->method('validateExpirationDate');
+ $manager->expects($this->never())->method('validateExpirationDateLink');
$this->hasher->expects($this->never())
->method('hash');
@@ -3482,7 +3482,7 @@ class ManagerTest extends \Test\TestCase {
'verifyPassword',
'pathCreateChecks',
'linkCreateChecks',
- 'validateExpirationDate',
+ 'validateExpirationDateLink',
])
->getMock();
@@ -3518,7 +3518,7 @@ class ManagerTest extends \Test\TestCase {
$manager->expects($this->never())->method('verifyPassword');
$manager->expects($this->never())->method('pathCreateChecks');
$manager->expects($this->never())->method('linkCreateChecks');
- $manager->expects($this->never())->method('validateExpirationDate');
+ $manager->expects($this->never())->method('validateExpirationDateLink');
$this->hasher->expects($this->never())
->method('hash');
@@ -3554,7 +3554,7 @@ class ManagerTest extends \Test\TestCase {
'verifyPassword',
'pathCreateChecks',
'linkCreateChecks',
- 'validateExpirationDate',
+ 'validateExpirationDateLink',
])
->getMock();
@@ -3590,7 +3590,7 @@ class ManagerTest extends \Test\TestCase {
$manager->expects($this->never())->method('verifyPassword');
$manager->expects($this->never())->method('pathCreateChecks');
$manager->expects($this->never())->method('linkCreateChecks');
- $manager->expects($this->never())->method('validateExpirationDate');
+ $manager->expects($this->never())->method('validateExpirationDateLink');
$this->hasher->expects($this->never())
->method('hash');
@@ -3626,7 +3626,7 @@ class ManagerTest extends \Test\TestCase {
'verifyPassword',
'pathCreateChecks',
'linkCreateChecks',
- 'validateExpirationDate',
+ 'validateExpirationDateLink',
])
->getMock();
@@ -3662,7 +3662,7 @@ class ManagerTest extends \Test\TestCase {
$manager->expects($this->never())->method('verifyPassword');
$manager->expects($this->never())->method('pathCreateChecks');
$manager->expects($this->never())->method('linkCreateChecks');
- $manager->expects($this->never())->method('validateExpirationDate');
+ $manager->expects($this->never())->method('validateExpirationDateLink');
$this->hasher->expects($this->once())
->method('verify')
@@ -3702,7 +3702,7 @@ class ManagerTest extends \Test\TestCase {
'verifyPassword',
'pathCreateChecks',
'linkCreateChecks',
- 'validateExpirationDate',
+ 'validateExpirationDateLink',
])
->getMock();
@@ -3738,7 +3738,7 @@ class ManagerTest extends \Test\TestCase {
$manager->expects($this->never())->method('verifyPassword');
$manager->expects($this->never())->method('pathCreateChecks');
$manager->expects($this->never())->method('linkCreateChecks');
- $manager->expects($this->never())->method('validateExpirationDate');
+ $manager->expects($this->never())->method('validateExpirationDateLink');
$this->hasher->expects($this->once())
->method('verify')
@@ -3778,7 +3778,7 @@ class ManagerTest extends \Test\TestCase {
'verifyPassword',
'pathCreateChecks',
'linkCreateChecks',
- 'validateExpirationDate',
+ 'validateExpirationDateLink',
])
->getMock();
@@ -3814,7 +3814,7 @@ class ManagerTest extends \Test\TestCase {
$manager->expects($this->never())->method('verifyPassword');
$manager->expects($this->never())->method('pathCreateChecks');
$manager->expects($this->never())->method('linkCreateChecks');
- $manager->expects($this->never())->method('validateExpirationDate');
+ $manager->expects($this->never())->method('validateExpirationDateLink');
$this->hasher->expects($this->never())
->method('verify');