|
|
|
|
@ -26,7 +26,12 @@ |
|
|
|
|
namespace OCA\Encryption\Tests; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use OC\Files\View; |
|
|
|
|
use OCA\Encryption\Util; |
|
|
|
|
use OCP\Files\Mount\IMountPoint; |
|
|
|
|
use OCP\IConfig; |
|
|
|
|
use OCP\ILogger; |
|
|
|
|
use OCP\IUserManager; |
|
|
|
|
use Test\TestCase; |
|
|
|
|
|
|
|
|
|
class UtilTest extends TestCase { |
|
|
|
|
@ -70,16 +75,16 @@ class UtilTest extends TestCase { |
|
|
|
|
|
|
|
|
|
protected function setUp() { |
|
|
|
|
parent::setUp(); |
|
|
|
|
$this->mountMock = $this->getMock('\OCP\Files\Mount\IMountPoint'); |
|
|
|
|
$this->filesMock = $this->getMock('OC\Files\View'); |
|
|
|
|
$this->userManagerMock = $this->getMock('\OCP\IUserManager'); |
|
|
|
|
$this->mountMock = $this->createMock(IMountPoint::class); |
|
|
|
|
$this->filesMock = $this->createMock(View::class); |
|
|
|
|
$this->userManagerMock = $this->createMock(IUserManager::class); |
|
|
|
|
|
|
|
|
|
/** @var \OCA\Encryption\Crypto\Crypt $cryptMock */ |
|
|
|
|
$cryptMock = $this->getMockBuilder('OCA\Encryption\Crypto\Crypt') |
|
|
|
|
->disableOriginalConstructor() |
|
|
|
|
->getMock(); |
|
|
|
|
/** @var \OCP\ILogger $loggerMock */ |
|
|
|
|
$loggerMock = $this->getMock('OCP\ILogger'); |
|
|
|
|
$loggerMock = $this->createMock(ILogger::class); |
|
|
|
|
/** @var \OCP\IUserSession|\PHPUnit_Framework_MockObject_MockObject $userSessionMock */ |
|
|
|
|
$userSessionMock = $this->getMockBuilder('OCP\IUserSession') |
|
|
|
|
->disableOriginalConstructor() |
|
|
|
|
@ -102,7 +107,7 @@ class UtilTest extends TestCase { |
|
|
|
|
->will($this->returnSelf()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->configMock = $this->getMock('OCP\IConfig'); |
|
|
|
|
$this->configMock = $this->createMock(IConfig::class); |
|
|
|
|
|
|
|
|
|
$this->configMock->expects($this->any()) |
|
|
|
|
->method('getUserValue') |
|
|
|
|
|