Repository navigation
Closed
Description
running the unit tests of CI3 leads to 1 error and 9 deprecation notices:
Deprecation notices:
There were 9 errors:
1) URI_test::test_filter_uri_passing
PHPUnit\Framework\Exception: PHP Deprecated: Creation of dynamic property URI_test::$ci_view_root is deprecated in /path_to_ci/CodeIgniter/tests/mocks/ci_testcase.php on line 41
PHP Deprecated: Creation of dynamic property Mock_Core_URI::$config is deprecated in /path_to_ci/CodeIgniter/tests/mocks/core/uri.php on line 19
PHP Deprecated: Creation of dynamic property URI_test::$uri is deprecated in /path_to_ci/CodeIgniter/tests/codeigniter/core/URI_test.php on line 7
2) URI_test::test_filter_uri_throws_error
PHPUnit\Framework\Exception: PHP Deprecated: Creation of dynamic property URI_test::$ci_view_root is deprecated in /path_to_ci/CodeIgniter/tests/mocks/ci_testcase.php on line 41
PHP Deprecated: Creation of dynamic property Mock_Core_URI::$config is deprecated in /path_to_ci/CodeIgniter/tests/mocks/core/uri.php on line 19
PHP Deprecated: Creation of dynamic property URI_test::$uri is deprecated in /path_to_ci/CodeIgniter/tests/codeigniter/core/URI_test.php on line 7
3) Utf8_test::test___constructUTF8_ENABLED
PHPUnit\Framework\Exception: PHP Deprecated: Creation of dynamic property Utf8_test::$ci_view_root is deprecated in /path_to_ci/CodeIgniter/tests/mocks/ci_testcase.php on line 41
4) Utf8_test::test__constructUTF8_DISABLED
PHPUnit\Framework\Exception: PHP Deprecated: Creation of dynamic property Utf8_test::$ci_view_root is deprecated in /path_to_ci/CodeIgniter/tests/mocks/ci_testcase.php on line 41
5) Utf8_test::test_is_ascii
PHPUnit\Framework\Exception: PHP Deprecated: Creation of dynamic property Utf8_test::$ci_view_root is deprecated in /path_to_ci/CodeIgniter/tests/mocks/ci_testcase.php on line 41
6) Utf8_test::test_convert_to_utf8
PHPUnit\Framework\Exception: PHP Deprecated: Creation of dynamic property Utf8_test::$ci_view_root is deprecated in /path_to_ci/CodeIgniter/tests/mocks/ci_testcase.php on line 41
7) Text_helper_test::test_highlight_phrase
PHPUnit\Framework\Exception: PHP Deprecated: Creation of dynamic property Text_helper_test::$ci_view_root is deprecated in /path_to_ci/CodeIgniter/tests/mocks/ci_testcase.php on line 41
8) Url_helper_test::test_url_title
PHPUnit\Framework\Exception: PHP Deprecated: Creation of dynamic property Url_helper_test::$ci_view_root is deprecated in /path_to_ci/CodeIgniter/tests/mocks/ci_testcase.php on line 41
9) Url_helper_test::test_url_title_extra_dashes
PHPUnit\Framework\Exception: PHP Deprecated: Creation of dynamic property Url_helper_test::$ci_view_root is deprecated in /path_to_ci/CodeIgniter/tests/mocks/ci_testcase.php on line 41
--
Failures
There was 1 failure:
1) Encryption_test::test_initialize_encrypt_decrypt
Failed asserting that false matches expected 'This is a plain-text message.'.
/path_to_ci/CodeIgniter/tests/codeigniter/libraries/Encryption_test.php:212
/path_to_ci/CodeIgniter/tests/mocks/ci_testcase.php:351
ERRORS!
Tests: 337, Assertions: 1076, Errors: 9, Failures: 1, Skipped: 25.
Metadata
Metadata
Assignees
Labels
No labels
Activity
tenzap commentedon Nov 6, 2022
PR #6173 fixes the deprecation warnings.
However, concerning the failure, it is different, so I will rename the title so that it is related to OpenSSL3.
With OpenSSL3, some ciphers are not available anymore when the legacy
provider is not enabled. Especially, 'des' cypher is provided by the legacy
provider in OpenSSL3, and the legacy provider is not enabled by default.
This leads to the failure of
Encryption_test::test_initialize_encrypt_decrypttest.See: https://wiki.openssl.org/index.php/OpenSSL_3.0#Providers
Since the test uses
it fails.
So a solution would be to use another cipher: "tripledes" instead of "des"
[-]unit tests with php8.2 failures[/-][+]unit tests Encryption_test::test_initialize_encrypt_decrypt files with OpenSSL3[/+][-]unit tests Encryption_test::test_initialize_encrypt_decrypt files with OpenSSL3[/-][+]unit tests Encryption_test::test_initialize_encrypt_decrypt fails with OpenSSL3[/+]tenzap commentedon Jun 24, 2023
Another solution which would make it work for both openssl 1 & 3
gxgpet commentedon Jan 14, 2024
Fixed via #6261.
We might consider the OpenSSL version/similar solution in the future, but for now, I marked the test as skipped for older PHP versions only.