Fix Encryption tests with phpunit 5.2+

This commit is contained in:
Joas Schilling 2016-07-01 16:22:50 +02:00
parent 28b3a0a37e
commit fd5bdf5e1a
No known key found for this signature in database
GPG Key ID: 70A0B324C41C0946
2 changed files with 6 additions and 7 deletions

View File

@ -27,6 +27,11 @@ namespace OCA\Encryption\Tests;
use OCA\Encryption\Migration;
use OCP\ILogger;
/**
* Class MigrationTest
* @package OCA\Encryption\Tests
* @group DB
*/
class MigrationTest extends \Test\TestCase {
const TEST_ENCRYPTION_MIGRATION_USER1='test_encryption_user1';
@ -39,7 +44,7 @@ class MigrationTest extends \Test\TestCase {
private $recovery_key_id = 'recovery_key_id';
private $moduleId;
/** @var PHPUnit_Framework_MockObject_MockObject | ILogger */
/** @var \PHPUnit_Framework_MockObject_MockObject | ILogger */
private $logger;
public static function setUpBeforeClass() {
@ -512,12 +517,9 @@ class MigrationTest extends \Test\TestCase {
*/
public function testGetTargetDir($user, $keyPath, $filename, $trash, $systemMounts, $expected) {
$updater = $this->getMockBuilder('\OC\Files\Cache\Updater')
->disableOriginalConstructor()->getMock();
$view = $this->getMockBuilder('\OC\Files\View')
->disableOriginalConstructor()->getMock();
$view->expects($this->any())->method('file_exists')->willReturn(true);
$view->expects($this->any())->method('getUpdater')->willReturn($updater);
$m = $this->getMockBuilder('OCA\Encryption\Migration')

View File

@ -142,9 +142,6 @@ class EncryptionTest extends TestCase {
$this->cryptMock->expects($this->any())
->method('multiKeyEncrypt')
->willReturn(true);
$this->cryptMock->expects($this->any())
->method('setAllFileKeys')
->willReturn(true);
$this->instance->end('/foo/bar');
}