2nd attempt to fix tests
This commit is contained in:
parent
87c640193b
commit
664e74a82e
|
@ -560,12 +560,6 @@ class EncryptionTest extends Storage {
|
|||
* @param string $strippedPath
|
||||
*/
|
||||
public function testGetHeader($path, $strippedPathExists, $strippedPath) {
|
||||
$cache = $this->getMockBuilder('\OC\Files\Cache\Cache')
|
||||
->disableOriginalConstructor()->getMock();
|
||||
$cache->expects($this->any())
|
||||
->method('get')
|
||||
->willReturn(['encrypted' => true]);
|
||||
|
||||
$sourceStorage = $this->getMockBuilder('\OC\Files\Storage\Storage')
|
||||
->disableOriginalConstructor()->getMock();
|
||||
|
||||
|
@ -580,6 +574,14 @@ class EncryptionTest extends Storage {
|
|||
]
|
||||
)->getMock();
|
||||
|
||||
$cache = $this->getMockBuilder('\OC\Files\Cache\Cache')
|
||||
->disableOriginalConstructor()->getMock();
|
||||
$cache->expects($this->any())
|
||||
->method('get')
|
||||
->willReturnCallback(function ($path) {
|
||||
return ['encrypted' => true, 'path' => $path];
|
||||
});
|
||||
|
||||
$instance = $this->getMockBuilder('\OC\Files\Storage\Wrapper\Encryption')
|
||||
->setConstructorArgs(
|
||||
[
|
||||
|
@ -595,6 +597,8 @@ class EncryptionTest extends Storage {
|
|||
->setMethods(['getCache','readFirstBlock', 'parseRawHeader'])
|
||||
->getMock();
|
||||
|
||||
$instance->expects($this->any())->method('getCache')->willReturn($cache);
|
||||
|
||||
$instance->expects($this->once())->method(('parseRawHeader'))
|
||||
->willReturn([Util::HEADER_ENCRYPTION_MODULE_KEY => 'OC_DEFAULT_MODULE']);
|
||||
|
||||
|
|
Loading…
Reference in New Issue