File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 1111use OC \Files \Storage \Temporary ;
1212use OC \Files \Storage \Wrapper \Encryption ;
1313use OC \Files \View ;
14+ use OCA \Encryption \KeyManager ;
1415use OCP \Files \Mount \IMountManager ;
1516use OCP \Files \Storage \IDisableEncryptionStorage ;
1617use OCP \Server ;
@@ -30,6 +31,8 @@ class EncryptedStorageTest extends TestCase {
3031 use UserTrait;
3132
3233 public function testMoveFromEncrypted (): void {
34+ Server::get (KeyManager::class)->validateMasterKey ();
35+ Server::get (KeyManager::class)->validateShareKey ();
3336 $ this ->createUser ('test1 ' , 'test2 ' );
3437 $ this ->setupForUser ('test1 ' , 'test2 ' );
3538
Original file line number Diff line number Diff line change 1212use OCA \Encryption \Crypto \Crypt ;
1313use OCA \Encryption \KeyManager ;
1414use OCA \Encryption \Users \Setup ;
15+ use OCP \ICache ;
16+ use OCP \ICacheFactory ;
1517use PHPUnit \Framework \MockObject \MockObject ;
1618use Test \TestCase ;
1719
@@ -32,9 +34,16 @@ protected function setUp(): void {
3234 ->disableOriginalConstructor ()
3335 ->getMock ();
3436
37+ $ cache = $ this ->createMock (ICache::class);
38+ $ cacheFactory = $ this ->createMock (ICacheFactory::class);
39+ $ cacheFactory ->method ('createLocal ' )
40+ ->willReturn ($ cache );
41+
3542 $ this ->instance = new Setup (
3643 $ this ->cryptMock ,
37- $ this ->keyManagerMock );
44+ $ this ->keyManagerMock ,
45+ $ cacheFactory ,
46+ );
3847 }
3948
4049
You can’t perform that action at this time.
0 commit comments