Remove extra spaces
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
parent
53e73dc46f
commit
9e84664f21
|
@ -769,7 +769,6 @@ class ManagerTest extends \Test\TestCase {
|
||||||
$this->expectException(\OCP\Share\Exceptions\GenericShareException::class);
|
$this->expectException(\OCP\Share\Exceptions\GenericShareException::class);
|
||||||
$this->expectExceptionMessage('Expiration date is in the past');
|
$this->expectExceptionMessage('Expiration date is in the past');
|
||||||
|
|
||||||
|
|
||||||
// Expire date in the past
|
// Expire date in the past
|
||||||
$past = new \DateTime();
|
$past = new \DateTime();
|
||||||
$past->sub(new \DateInterval('P1D'));
|
$past->sub(new \DateInterval('P1D'));
|
||||||
|
@ -780,7 +779,6 @@ class ManagerTest extends \Test\TestCase {
|
||||||
self::invokePrivate($this->manager, 'validateExpirationDate', [$share]);
|
self::invokePrivate($this->manager, 'validateExpirationDate', [$share]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function testValidateExpirationDateEnforceButNotSet() {
|
public function testValidateExpirationDateEnforceButNotSet() {
|
||||||
$this->expectException(\InvalidArgumentException::class);
|
$this->expectException(\InvalidArgumentException::class);
|
||||||
$this->expectExceptionMessage('Expiration date is enforced');
|
$this->expectExceptionMessage('Expiration date is enforced');
|
||||||
|
@ -875,7 +873,7 @@ class ManagerTest extends \Test\TestCase {
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$hookListener = $this->getMockBuilder('Dummy')->setMethods(['listener'])->getMock();
|
$hookListener = $this->getMockBuilder('Dummy')->setMethods(['listener'])->getMock();
|
||||||
\OCP\Util::connectHook('\OC\Share', 'verifyExpirationDate', $hookListener, 'listener');
|
\OCP\Util::connectHook('\OC\Share', 'verifyExpirationDate', $hookListener, 'listener');
|
||||||
$hookListener->expects($this->once())->method('listener')->with($this->callback(function ($data) use ($future) {
|
$hookListener->expects($this->once())->method('listener')->with($this->callback(function ($data) use ($future) {
|
||||||
return $data['expirationDate'] == $future;
|
return $data['expirationDate'] == $future;
|
||||||
}));
|
}));
|
||||||
|
@ -896,7 +894,7 @@ class ManagerTest extends \Test\TestCase {
|
||||||
$share->setExpirationDate($date);
|
$share->setExpirationDate($date);
|
||||||
|
|
||||||
$hookListener = $this->getMockBuilder('Dummy')->setMethods(['listener'])->getMock();
|
$hookListener = $this->getMockBuilder('Dummy')->setMethods(['listener'])->getMock();
|
||||||
\OCP\Util::connectHook('\OC\Share', 'verifyExpirationDate', $hookListener, 'listener');
|
\OCP\Util::connectHook('\OC\Share', 'verifyExpirationDate', $hookListener, 'listener');
|
||||||
$hookListener->expects($this->once())->method('listener')->with($this->callback(function ($data) use ($expected) {
|
$hookListener->expects($this->once())->method('listener')->with($this->callback(function ($data) use ($expected) {
|
||||||
return $data['expirationDate'] == $expected && $data['passwordSet'] === false;
|
return $data['expirationDate'] == $expected && $data['passwordSet'] === false;
|
||||||
}));
|
}));
|
||||||
|
@ -908,7 +906,7 @@ class ManagerTest extends \Test\TestCase {
|
||||||
|
|
||||||
public function testValidateExpirationDateNoDateNoDefault() {
|
public function testValidateExpirationDateNoDateNoDefault() {
|
||||||
$hookListener = $this->getMockBuilder('Dummy')->setMethods(['listener'])->getMock();
|
$hookListener = $this->getMockBuilder('Dummy')->setMethods(['listener'])->getMock();
|
||||||
\OCP\Util::connectHook('\OC\Share', 'verifyExpirationDate', $hookListener, 'listener');
|
\OCP\Util::connectHook('\OC\Share', 'verifyExpirationDate', $hookListener, 'listener');
|
||||||
$hookListener->expects($this->once())->method('listener')->with($this->callback(function ($data) {
|
$hookListener->expects($this->once())->method('listener')->with($this->callback(function ($data) {
|
||||||
return $data['expirationDate'] === null && $data['passwordSet'] === true;
|
return $data['expirationDate'] === null && $data['passwordSet'] === true;
|
||||||
}));
|
}));
|
||||||
|
@ -938,7 +936,7 @@ class ManagerTest extends \Test\TestCase {
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$hookListener = $this->getMockBuilder('Dummy')->setMethods(['listener'])->getMock();
|
$hookListener = $this->getMockBuilder('Dummy')->setMethods(['listener'])->getMock();
|
||||||
\OCP\Util::connectHook('\OC\Share', 'verifyExpirationDate', $hookListener, 'listener');
|
\OCP\Util::connectHook('\OC\Share', 'verifyExpirationDate', $hookListener, 'listener');
|
||||||
$hookListener->expects($this->once())->method('listener')->with($this->callback(function ($data) use ($expected) {
|
$hookListener->expects($this->once())->method('listener')->with($this->callback(function ($data) use ($expected) {
|
||||||
return $data['expirationDate'] == $expected;
|
return $data['expirationDate'] == $expected;
|
||||||
}));
|
}));
|
||||||
|
@ -956,7 +954,7 @@ class ManagerTest extends \Test\TestCase {
|
||||||
$save = clone $nextWeek;
|
$save = clone $nextWeek;
|
||||||
|
|
||||||
$hookListener = $this->getMockBuilder('Dummy')->setMethods(['listener'])->getMock();
|
$hookListener = $this->getMockBuilder('Dummy')->setMethods(['listener'])->getMock();
|
||||||
\OCP\Util::connectHook('\OC\Share', 'verifyExpirationDate', $hookListener, 'listener');
|
\OCP\Util::connectHook('\OC\Share', 'verifyExpirationDate', $hookListener, 'listener');
|
||||||
$hookListener->expects($this->once())->method('listener')->willReturnCallback(function ($data) {
|
$hookListener->expects($this->once())->method('listener')->willReturnCallback(function ($data) {
|
||||||
$data['expirationDate']->sub(new \DateInterval('P2D'));
|
$data['expirationDate']->sub(new \DateInterval('P2D'));
|
||||||
});
|
});
|
||||||
|
@ -970,7 +968,6 @@ class ManagerTest extends \Test\TestCase {
|
||||||
$this->assertEquals($save, $share->getExpirationDate());
|
$this->assertEquals($save, $share->getExpirationDate());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function testValidateExpirationDateHookException() {
|
public function testValidateExpirationDateHookException() {
|
||||||
$this->expectException(\Exception::class);
|
$this->expectException(\Exception::class);
|
||||||
$this->expectExceptionMessage('Invalid date!');
|
$this->expectExceptionMessage('Invalid date!');
|
||||||
|
@ -983,7 +980,7 @@ class ManagerTest extends \Test\TestCase {
|
||||||
$share->setExpirationDate($nextWeek);
|
$share->setExpirationDate($nextWeek);
|
||||||
|
|
||||||
$hookListener = $this->getMockBuilder('Dummy')->setMethods(['listener'])->getMock();
|
$hookListener = $this->getMockBuilder('Dummy')->setMethods(['listener'])->getMock();
|
||||||
\OCP\Util::connectHook('\OC\Share', 'verifyExpirationDate', $hookListener, 'listener');
|
\OCP\Util::connectHook('\OC\Share', 'verifyExpirationDate', $hookListener, 'listener');
|
||||||
$hookListener->expects($this->once())->method('listener')->willReturnCallback(function ($data) {
|
$hookListener->expects($this->once())->method('listener')->willReturnCallback(function ($data) {
|
||||||
$data['accepted'] = false;
|
$data['accepted'] = false;
|
||||||
$data['message'] = 'Invalid date!';
|
$data['message'] = 'Invalid date!';
|
||||||
|
@ -1008,7 +1005,6 @@ class ManagerTest extends \Test\TestCase {
|
||||||
$this->assertEquals(null, $share->getExpirationDate());
|
$this->assertEquals(null, $share->getExpirationDate());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function testUserCreateChecksShareWithGroupMembersOnlyDifferentGroups() {
|
public function testUserCreateChecksShareWithGroupMembersOnlyDifferentGroups() {
|
||||||
$this->expectException(\Exception::class);
|
$this->expectException(\Exception::class);
|
||||||
$this->expectExceptionMessage('Sharing is only allowed with group members');
|
$this->expectExceptionMessage('Sharing is only allowed with group members');
|
||||||
|
|
Loading…
Reference in New Issue