Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update HeaderValue.php #463

Merged
merged 6 commits into from
Dec 20, 2024
Merged

Update HeaderValue.php #463

merged 6 commits into from
Dec 20, 2024

Conversation

icyz
Copy link

@icyz icyz commented Dec 10, 2024

header validation with RFC 6532 instead of RFC 2822

header validation with RFC 6532 instead of RFC 2822
@develart-projects
Copy link
Collaborator

Please adjust the tests to cover the new testing:

There were 6 failures:

  1. Zend_Mail_Header_HeaderValueTest::testValidateValue with data set Tag a new release for the latest php73 fixes #4 ('This is a \r\ntest', 'assertFalse')
    Failed asserting that true is false.

/home/runner/work/zf1-future/zf1-future/tests/Zend/Mail/Header/HeaderValueTest.php:85
/home/runner/work/zf1-future/zf1-future/tests/resources/Runner.php:20
/home/runner/work/zf1-future/zf1-future/tests/Zend/AllTests.php:143
/home/runner/work/zf1-future/zf1-future/tests/Zend/AllTests.php:267

  1. Zend_Mail_Header_HeaderValueTest::testValidateValue with data set Several fixes for usage with php 7.3  #9 ('This is a \r\n\r\ntest', 'assertFalse')
    Failed asserting that true is false.

/home/runner/work/zf1-future/zf1-future/tests/Zend/Mail/Header/HeaderValueTest.php:85
/home/runner/work/zf1-future/zf1-future/tests/resources/Runner.php:20
/home/runner/work/zf1-future/zf1-future/tests/Zend/AllTests.php:143
/home/runner/work/zf1-future/zf1-future/tests/Zend/AllTests.php:267

  1. Zend_Mail_Header_HeaderValueTest::testAssertValidRaisesExceptionForInvalidValues with data set PHP Fatal error: Declaration of Zend_Rest_Route::assemble($data = Array, $reset = false, $encode = true) must be compatible with Zend_Controller_Router_Route_Module::assemble($data = Array, $reset = false, $encode = true, $partial = false) #3 ('This is a \r\ntest')
    Failed asserting that exception of type "Zend_Mail_Exception" is thrown.

/home/runner/work/zf1-future/zf1-future/tests/resources/Runner.php:20
/home/runner/work/zf1-future/zf1-future/tests/Zend/AllTests.php:143
/home/runner/work/zf1-future/zf1-future/tests/Zend/AllTests.php:267

  1. Zend_Mail_Header_HeaderValueTest::testAssertValidRaisesExceptionForInvalidValues with data set Warning in PHP 7.3 using 'continue' in switch statement #8 ('This is a \r\n\r\ntest')
    Failed asserting that exception of type "Zend_Mail_Exception" is thrown.

/home/runner/work/zf1-future/zf1-future/tests/resources/Runner.php:20
/home/runner/work/zf1-future/zf1-future/tests/Zend/AllTests.php:143
/home/runner/work/zf1-future/zf1-future/tests/Zend/AllTests.php:267

  1. Zend_Mail_MessageTest::testRaisesExceptionWhenProvidedWithHeaderContainingCRLFInjection with data set "value" ('Fake', 'foo-bar\r\n\r\nevilContent')
    Failed asserting that exception of type "Zend_Mail_Exception" is thrown.

/home/runner/work/zf1-future/zf1-future/tests/resources/Runner.php:20
/home/runner/work/zf1-future/zf1-future/tests/Zend/AllTests.php:143
/home/runner/work/zf1-future/zf1-future/tests/Zend/AllTests.php:267

  1. Zend_Mail_MessageTest::testRaisesExceptionWhenProvidedWithHeaderContainingCRLFInjection with data set "multi-value" ('Fake', array('okay', 'foo-bar\r\n\r\nevilContent'))
    Failed asserting that exception of type "Zend_Mail_Exception" is thrown.

/home/runner/work/zf1-future/zf1-future/tests/resources/Runner.php:20
/home/runner/work/zf1-future/zf1-future/tests/Zend/AllTests.php:143
/home/runner/work/zf1-future/zf1-future/tests/Zend/AllTests.php:267

Copy link
Author

@icyz icyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test changed for RFC 6532

@icyz
Copy link
Author

icyz commented Dec 11, 2024

I'm having some issues handling unittest because I can't test directly on my local environment.

Syntax error ...
Copy link
Author

@icyz icyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax error

@icyz
Copy link
Author

icyz commented Dec 13, 2024

Can someone help with managing the tests?

@develart-projects
Copy link
Collaborator

This is how I'm starting the tests locally:

php "/usr/share/NetBeansProjects/ZF1-Future/bin/phpunit" "--colors" "--configuration" "/usr/share/NetBeansProjects/ZF1-Future/tests/phpunit.xml" "/usr/share/NetBeansProjects/ZF1-Future/tests/AllTests.php"

@icyz
Copy link
Author

icyz commented Dec 18, 2024

I tested the newly downloaded project and encountered some errors...

using php 8.2
~/zf1-future$ /bin/php8.2 bin/phpunit "--colors" "--configuration" "tests/phpunit.xml" "tests/AllTests.php"

this is the output:
FAILURES! Tests: 10803, Assertions: 359229, Failures: 2, Warnings: 7, Skipped: 666, Incomplete: 13.

using php 8.1
~/zf1-future$ /bin/php8.1 bin/phpunit "--colors" "--configuration" "tests/phpunit.xml" "tests/AllTests.php"
FAILURES! Tests: 10803, Assertions: 359560, Failures: 2, Warnings: 7, Skipped: 558, Incomplete: 16.

@develart-projects
Copy link
Collaborator

Could you pls copy the 2 errors?

@develart-projects
Copy link
Collaborator

I mean failures.

@icyz
Copy link
Author

icyz commented Dec 18, 2024

phpunit.txt

This is the full report... I hope it will be useful.

@develart-projects
Copy link
Collaborator

There are 2 failed translation tests, you can ignore them for now.

@develart-projects
Copy link
Collaborator

Pls try to fix the tests with you local change. That's enough for you PR, thanks.

@develart-projects
Copy link
Collaborator

(ignoring those 2)

Copy link
Author

@icyz icyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed CRLF test because it's allowed in RFC 5322 and 6532

@icyz
Copy link
Author

icyz commented Dec 20, 2024

🥳

@develart-projects develart-projects merged commit dd61131 into Shardj:master Dec 20, 2024
11 checks passed
@develart-projects develart-projects added enhancement New feature or request to be released PR exists or in master, but not released yet labels Dec 20, 2024
@develart-projects develart-projects added this to the 1.24.3 milestone Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request to be released PR exists or in master, but not released yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants