Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix unit tests
  • Loading branch information
DeepDiver1975 authored and Vincent Petry committed Aug 17, 2016
commit 1c06fe1490547d378dd6cf96e2fbca54a7ff9936
10 changes: 7 additions & 3 deletions tests/lib/Encryption/DecryptAllTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ public function dataTestDecryptAllUsersFiles() {
}

public function testDecryptUsersFiles() {
$storage = $this->getMockBuilder('OC\Files\Storage\Shared')
->disableOriginalConstructor()
->getMock();

/** @var DecryptAll | \PHPUnit_Framework_MockObject_MockObject $instance */
$instance = $this->getMockBuilder('OC\Encryption\DecryptAll')
->setConstructorArgs(
Expand All @@ -254,15 +258,15 @@ public function testDecryptUsersFiles() {
$this->view->expects($this->at(0))->method('getDirectoryContent')
->with('/user1/files')->willReturn(
[
new FileInfo('path', null, 'intPath', ['name' => 'foo', 'type'=>'dir'], null),
new FileInfo('path', null, 'intPath', ['name' => 'bar', 'type'=>'file', 'encrypted'=>true], null)
new FileInfo('path', $storage, 'intPath', ['name' => 'foo', 'type'=>'dir'], null),
new FileInfo('path', $storage, 'intPath', ['name' => 'bar', 'type'=>'file', 'encrypted'=>true], null)
]
);

$this->view->expects($this->at(3))->method('getDirectoryContent')
->with('/user1/files/foo')->willReturn(
[
new FileInfo('path', null, 'intPath', ['name' => 'subfile', 'type'=>'file', 'encrypted'=>true], null)
new FileInfo('path', $storage, 'intPath', ['name' => 'subfile', 'type'=>'file', 'encrypted'=>true], null)
]
);

Expand Down