/** * by default the encryption module should encrypt regular files, files in * files_versions and files in files_trashbin * * @dataProvider dataTestShouldEncrypt */ public function testShouldEncrypt($path, $shouldEncryptHomeStorage, $isHomeStorage, $expected) { $this->utilMock->expects($this->once())->method('shouldEncryptHomeStorage')->willReturn($shouldEncryptHomeStorage); if ($shouldEncryptHomeStorage === false) { $this->storageMock->expects($this->once())->method('instanceOfStorage')->with('\\OCP\\Files\\IHomeStorage')->willReturn($isHomeStorage); $this->utilMock->expects($this->once())->method('getStorage')->with($path)->willReturn($this->storageMock); } $this->assertSame($expected, $this->instance->shouldEncrypt($path)); }