2 declare(strict_types = 1);
21 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
36 protected function setUp()
38 $GLOBALS[
'TYPO3_CONF_VARS'][
'EXTENSIONS'][
'rsaauth'][
'temporaryDirectory'] =
'';
48 $keyPair = $subject->createNewKeyPair();
49 if ($keyPair ===
null) {
50 $this->markTestSkipped(
'KeyPair could not be generated. Maybe openssl was not found.');
53 $this->assertTrue($keyPair->isReady());
63 $keyPair = $subject->createNewKeyPair();
64 if ($keyPair ===
null) {
65 $this->markTestSkipped(
'KeyPair could not be generated. Maybe openssl was not found.');
70 $keyPair->getExponent()
82 $subject->createNewKeyPair(),
83 $subject->createNewKeyPair()
92 $this->expectException(\RuntimeException::class);
93 $this->expectExceptionCode(1531336156);
96 $serialized = serialize($subject);
97 unserialize($serialized);
106 $subject = $this->getAccessibleMock(CommandLineBackend::class);
107 $subject->_set(
'opensslPath',
'foo');
108 $subject->_set(
'temporaryDirectory',
'foo');
109 $serialized = serialize($subject);
110 unserialize($serialized);
111 }
catch (\RuntimeException $e) {
112 $this->assertNull($subject->_get(
'opensslPath'));
113 $this->assertNull($subject->_get(
'temporaryDirectory'));
120 $this->markTestSkipped(
121 'This test is not available on Windows as auto-detection of openssl path will fail.'