File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,24 @@ public function setUp(): void {
3434 // Reset settings
3535 $ this ->getMockAppConfig ()->setValueBool (Application::APP_ID , 'identification_documents ' , false );
3636
37+ // Setup CA certificate for CRL tests
38+ $ this ->setupCertificateEngine ();
39+
3740 $ this ->request = new \OCA \Libresign \Tests \Api \ApiRequester ();
3841 }
3942
43+ private function setupCertificateEngine (): void {
44+ // Clean up any existing CRL data that might have invalid reason codes
45+ $ crlMapper = \OCP \Server::get (\OCA \Libresign \Db \CrlMapper::class);
46+ $ connection = \OC ::$ server ->getDatabaseConnection ();
47+ $ connection ->executeStatement ('DELETE FROM oc_libresign_crl ' );
48+
49+ // Create a root certificate for testing
50+ $ factory = \OCP \Server::get (\OCA \Libresign \Handler \CertificateEngine \CertificateEngineFactory::class);
51+ $ engine = $ factory ->getEngine ();
52+ $ engine ->generateRootCert ('Test Root CA ' , []);
53+ }
54+
4055 /**
4156 * @runInSeparateProcess
4257 */
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ public function testEntityBasicFunctionality(): void {
2525
2626 $ this ->assertEquals (123456 , $ certificate ->getSerialNumber ());
2727 $ this ->assertEquals ('test-owner ' , $ certificate ->getOwner ());
28- $ this ->assertEquals (CRLStatus::ISSUED , $ certificate ->getStatus ());
28+ $ this ->assertEquals (CRLStatus::ISSUED -> value , $ certificate ->getStatus ());
2929 $ this ->assertFalse ($ certificate ->isRevoked ());
3030 $ this ->assertTrue ($ certificate ->isValid ());
3131 }
You can’t perform that action at this time.
0 commit comments