Skip to content

Commit e3fde53

Browse files
committed
fix: replace vitual file system by temp folder
The openssl extension don't work fine with virtual file system Signed-off-by: Vitor Mattos <vitor@php.rio>
1 parent 03b36b2 commit e3fde53

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tests/Unit/Handler/CertificateEngine/OpenSslHandlerTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,15 @@ final class OpenSslHandlerTest extends \OCA\Libresign\Tests\Unit\TestCase {
2525
private ITempManager $tempManager;
2626
private OpenSslHandler $openSslHandler;
2727
protected CertificatePolicyService $certificatePolicyService;
28+
private string $tempDir;
2829
public function setUp(): void {
2930
$this->config = \OCP\Server::get(IConfig::class);
3031
$this->appConfig = \OCP\Server::get(IAppConfig::class);
3132
$this->appDataFactory = \OCP\Server::get(IAppDataFactory::class);
3233
$this->dateTimeFormatter = \OCP\Server::get(IDateTimeFormatter::class);
3334
$this->tempManager = \OCP\Server::get(ITempManager::class);
3435
$this->certificatePolicyService = \OCP\Server::get(certificatePolicyService::class);
35-
36-
// The storage can't be modified when create a new instance to
37-
// don't lost the root cert
38-
vfsStream::setup('certificate');
36+
$this->tempDir = $this->tempManager->getTemporaryFolder('certificate');
3937
}
4038

4139
private function getInstance(): OpenSslHandler {
@@ -47,7 +45,7 @@ private function getInstance(): OpenSslHandler {
4745
$this->tempManager,
4846
$this->certificatePolicyService,
4947
);
50-
$this->openSslHandler->setConfigPath('vfs://certificate/');
48+
$this->openSslHandler->setConfigPath($this->tempDir);
5149
return $this->openSslHandler;
5250
}
5351

0 commit comments

Comments
 (0)