diff --git a/.changes/nextrelease/ci-image-update b/.changes/nextrelease/ci-image-update new file mode 100644 index 0000000000..d6c173019b --- /dev/null +++ b/.changes/nextrelease/ci-image-update @@ -0,0 +1,7 @@ +[ + { + "type": "enhancement", + "category": "", + "description": "Update the image used in CI-jobs from ubuntu-18.04 to ubuntu-22.04." + } +] \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2d5ed13f1a..52e2dba954 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,12 +12,13 @@ permissions: jobs: run: - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 strategy: #for each of the following versions of PHP, with and without --prefer-lowest matrix: php-versions: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] composer-options: ['', '--prefer-lowest'] + #set the name for each job name: PHP ${{ matrix.php-versions }} ${{ matrix.composer-options }} #set up environment variables used by unit tests diff --git a/tests/CloudFront/SignerTest.php b/tests/CloudFront/SignerTest.php index a8d03f4398..4357131b11 100644 --- a/tests/CloudFront/SignerTest.php +++ b/tests/CloudFront/SignerTest.php @@ -39,7 +39,14 @@ public function testBadPrivateKeyContents() { * Assert that the key file is parsed during construction */ public function testBadPrivateKeyPath() { - $this->expectExceptionMessageMatches("/PEM .*no start line/"); + preg_match('/OpenSSL (?\d+\.\d+\.\d+)/',OPENSSL_VERSION_TEXT,$matches); + // OpenSSL 1.* and 3.* do not return the same error-message + if (isset($matches['version']) && version_compare($matches['version'],'3.0','>=')) { + $this->expectExceptionMessageMatches("/error:1E08010C:DECODER routines::unsupported/"); + } else { + $this->expectExceptionMessageMatches("/PEM .*no start line/"); + } + $this->expectException(\InvalidArgumentException::class); $filename = tempnam(sys_get_temp_dir(), 'cloudfront-fake-key'); file_put_contents($filename, "Not a real private key"); diff --git a/tests/Crypto/Polyfill/AesGcmTest.php b/tests/Crypto/Polyfill/AesGcmTest.php index 9e44ce3758..641e26b8b7 100644 --- a/tests/Crypto/Polyfill/AesGcmTest.php +++ b/tests/Crypto/Polyfill/AesGcmTest.php @@ -2644,8 +2644,16 @@ public function testCompat() $aad, $tag2 ); - $this->assertSame(bin2hex($exp), bin2hex($got)); - $this->assertSame(bin2hex($tag1), bin2hex($tag2)); + + $failureMessage = sprintf("Failed with parameters:\n\tplaintext: %s\n\taad: %s\n\tkey: %s\n\tnonce: %s", + bin2hex($plaintext), + bin2hex($aad), + bin2hex($key), + bin2hex($nonce) + ); + + $this->assertSame(bin2hex($exp), bin2hex($got),$failureMessage); + $this->assertSame(bin2hex($tag1), bin2hex($tag2),$failureMessage); } } }