aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-09-09 20:39:19 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2019-09-14 13:52:10 +0200
commit2b98eea1297a8024650c456fccbc33824721053e (patch)
tree8736f4693dfb086d70cf26fe69115f442c8e3d8e /tests/lib
parent89d3b2cdd3c43386dea4f985e890ad332d8e6249 (diff)
downloadnextcloud-server-2b98eea1297a8024650c456fccbc33824721053e.tar.gz
nextcloud-server-2b98eea1297a8024650c456fccbc33824721053e.zip
Harden identifyproof openssl code
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/Security/IdentityProof/ManagerTest.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/tests/lib/Security/IdentityProof/ManagerTest.php b/tests/lib/Security/IdentityProof/ManagerTest.php
index 9d17182e52e..2d66845ba8d 100644
--- a/tests/lib/Security/IdentityProof/ManagerTest.php
+++ b/tests/lib/Security/IdentityProof/ManagerTest.php
@@ -29,22 +29,26 @@ use OCP\Files\IAppData;
use OCP\Files\SimpleFS\ISimpleFile;
use OCP\Files\SimpleFS\ISimpleFolder;
use OCP\IConfig;
+use OCP\ILogger;
use OCP\IUser;
use OCP\Security\ICrypto;
+use PHPUnit\Framework\MockObject\MockObject;
use SebastianBergmann\Comparator\MockObjectComparator;
use Test\TestCase;
class ManagerTest extends TestCase {
- /** @var Factory|\PHPUnit_Framework_MockObject_MockObject */
+ /** @var Factory|MockObject */
private $factory;
- /** @var IAppData|\PHPUnit_Framework_MockObject_MockObject */
+ /** @var IAppData|MockObject */
private $appData;
- /** @var ICrypto|\PHPUnit_Framework_MockObject_MockObject */
+ /** @var ICrypto|MockObject */
private $crypto;
- /** @var Manager|\PHPUnit_Framework_MockObject_MockObject */
+ /** @var Manager|MockObject */
private $manager;
- /** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */
+ /** @var IConfig|MockObject */
private $config;
+ /** @var ILogger|MockObject */
+ private $logger;
public function setUp() {
parent::setUp();
@@ -57,6 +61,7 @@ class ManagerTest extends TestCase {
->method('get')
->with('identityproof')
->willReturn($this->appData);
+ $this->logger = $this->createMock(ILogger::class);
$this->crypto = $this->createMock(ICrypto::class);
$this->manager = $this->getManager(['generateKeyPair']);
@@ -73,14 +78,16 @@ class ManagerTest extends TestCase {
return new Manager(
$this->factory,
$this->crypto,
- $this->config
+ $this->config,
+ $this->logger
);
} else {
return $this->getMockBuilder(Manager::class)
->setConstructorArgs([
$this->factory,
$this->crypto,
- $this->config
+ $this->config,
+ $this->logger
])->setMethods($setMethods)->getMock();
}
}