@@ -28,6 +28,7 @@ final class IntegrationConfig
2828 ];
2929
3030 private const DEFAULT_CLIENT_CERT_CANDIDATES = [
31+ 'tests/fixtures/dummy-client-cert.pem ' ,
3132 'tests/fixtures/oblak.pem ' ,
3233 'tests/fixtures/client.pem ' ,
3334 'tests/Fixtures/client.pem ' ,
@@ -92,9 +93,9 @@ public static function ensureReadyOrFail(): void
9293 {
9394 self ::ensureEnvOrFail ('RNIDS_EPP_USERNAME ' );
9495 self ::ensureEnvOrFail ('RNIDS_EPP_PASSWORD ' );
96+ self ::port ();
9597 self ::ensureFileOrFail (self ::clientCertificatePath (), 'RNIDS client certificate ' );
9698 self ::ensureFileOrFail (self ::caCertificatePath (), 'RNIDS CA certificate ' );
97- self ::port ();
9899 }
99100
100101 public static function liveReadinessFailureReason (): ?string
@@ -104,9 +105,11 @@ public static function liveReadinessFailureReason(): ?string
104105 $ port = self ::DEFAULT_PORT ;
105106
106107 foreach ([ 'RNIDS_EPP_USERNAME ' , 'RNIDS_EPP_PASSWORD ' ] as $ requiredEnv ) {
107- if (null = == self ::nonEmptyEnvOrNull ($ requiredEnv )) {
108- $ issues [] = \sprintf ( ' missing %s ' , $ requiredEnv ) ;
108+ if (null ! == self ::nonEmptyEnvOrNull ($ requiredEnv )) {
109+ continue ;
109110 }
111+
112+ $ issues [] = \sprintf ('missing %s ' , $ requiredEnv );
110113 }
111114
112115 try {
@@ -370,7 +373,10 @@ private static function ensureEnvOrFail(string $name): void
370373
371374 if (!\is_string ($ value ) || '' === \trim ($ value )) {
372375 throw new \RuntimeException (
373- \sprintf ('Missing required environment variable "%s" for RNIDS live integration tests. ' , $ name ),
376+ \sprintf (
377+ 'Missing required environment variable "%s" for RNIDS live integration tests. ' ,
378+ $ name ,
379+ ),
374380 );
375381 }
376382 }
@@ -413,13 +419,17 @@ private static function port(): int
413419 }
414420
415421 if (!\preg_match ('/^\d+$/ ' , $ port )) {
416- throw new \RuntimeException ('Environment variable "RNIDS_EPP_PORT" must be an integer between 1 and 65535. ' );
422+ throw new \RuntimeException (
423+ 'Environment variable "RNIDS_EPP_PORT" must be an integer between 1 and 65535. ' ,
424+ );
417425 }
418426
419427 $ parsedPort = (int ) $ port ;
420428
421429 if ($ parsedPort < 1 || $ parsedPort > 65535 ) {
422- throw new \RuntimeException ('Environment variable "RNIDS_EPP_PORT" must be an integer between 1 and 65535. ' );
430+ throw new \RuntimeException (
431+ 'Environment variable "RNIDS_EPP_PORT" must be an integer between 1 and 65535. ' ,
432+ );
423433 }
424434
425435 return $ parsedPort ;
@@ -436,7 +446,7 @@ private static function isHostResolvable(string $host): bool
436446 return false ;
437447 }
438448
439- if (\filter_var ($ host , \FILTER_VALIDATE_IP ) !== false ) {
449+ if (false !== \filter_var ($ host , \FILTER_VALIDATE_IP )) {
440450 return true ;
441451 }
442452
@@ -446,7 +456,9 @@ private static function isHostResolvable(string $host): bool
446456 private static function isTcpEndpointReachable (string $ host , int $ port , float $ timeoutSeconds ): bool
447457 {
448458 $ flags = \STREAM_CLIENT_CONNECT ;
449- $ context = \stream_context_create ([ 'ssl ' => [ 'verify_peer ' => false , 'verify_peer_name ' => false ] ]);
459+ $ context = \stream_context_create (
460+ [ 'ssl ' => [ 'verify_peer ' => false , 'verify_peer_name ' => false ] ],
461+ );
450462 $ socket = @\stream_socket_client (
451463 \sprintf ('tcp://%s:%d ' , $ host , $ port ),
452464 $ errorCode ,
0 commit comments