test: Increase Email test coverage and enable component in random tests#10411
test: Increase Email test coverage and enable component in random tests#10411gr8man wants to merge 6 commits into
Conversation
71e52b3 to
e22a54b
Compare
michalsn
left a comment
There was a problem hiding this comment.
Please remove the newly added tests that depend on the namespace-level native-function mocks, together with the global variables used to control them.
Although namespace-level function shadowing can be useful for isolated cases, using it here across nine native functions creates persistent process-level behavior and substantial global test state. This makes the tests difficult to isolate and maintain, and several mocks replace native behavior even when a test has not explicitly configured them.
| @@ -197,7 +197,7 @@ class Email | |||
| * | |||
| * @see http://www.ietf.org/rfc/rfc822.txt | |||
| * | |||
| * @var "\n"|"\r\n" | |||
| * @var string | |||
There was a problem hiding this comment.
You're weakening annotations. Please revert.
| { | ||
| use ReflectionHelper; | ||
|
|
||
| protected function tearDown(): void |
There was a problem hiding this comment.
If this method is needed, you have to call parent::tearDown().
9af1c02 to
a1d6bf0
Compare
a1d6bf0 to
a5a67e1
Compare
6fffb0d to
df7fcc7
Compare
|
I cannot fix the PHPDoc type typo (@var "\r\n"|"n") directly in system/Email/Email.php because of an upstream issue with PHP-CS-Fixer's global_namespace_import rule. Since Email.php has a namespace (CodeIgniter\Email), the fixer incorrectly treats the \n inside the PHPDoc string as a global class, stripping the backslash and erroneously injecting a use n; statement at the top of the file, which breaks the build. |
Description
Ref: #9968
Emailclass (covering header injection prevention, SMTP disconnection handling, UTF-8 filenames, and other edge cases).tearDown().Emailcomponent in the random tests execution configuration (random-tests-config.txt).$newlineproperty inEmail.php.Checklist: