Page MenuHomePhorge

Add first unit test for mimemailparser headers
ClosedPublic

Authored by valerio.bozzolan on Dec 3 2024, 15:44.
Tags
None
Referenced Files
F3826855: D25844.1746036190.diff
Tue, Apr 29, 18:03
F3645515: D25844.1745379489.diff
Tue, Apr 22, 03:38
F3644790: D25844.1745338017.diff
Mon, Apr 21, 16:06
F3644777: D25844.1745336621.diff
Mon, Apr 21, 15:43
F3619840: D25844.1745309200.diff
Mon, Apr 21, 08:06
F3606597: D25844.1745286953.diff
Mon, Apr 21, 01:55
F3605456: D25844.1745270475.diff
Sun, Apr 20, 21:21
F3601258: D25844.1745150581.diff
Sat, Apr 19, 12:03

Details

Summary

Uploaded an example email with a lot of accents called 'test_accents.mbox' and
expected headers in the file 'test_accents.headers.txt'.

Better than nothing.

This change also includes a minor refactor in the library loading.

Ref T15960

Test Plan

Manually run the new unit test and see green lights:

arc unit src/applications/metamta/externals/__tests__/PhabricatorExternalMimeMailParserTestCase.php

Double-check that the new class is already recorded:

arc liberate

Just as extra care, re-apply the same test plan of:

D25839

So, for example, run this, and see no exceptions:

./scripts/mail/mail_handler.php < src/applications/metamta/externals/__tests__/data/test_accents.mbox

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lol @taavi I've stolen some of your "ä" for the example file test_accents.mbox, I hope you won't send me a lawyer

I hope you won't send me a lawyer

do you really think I could afford one

Thanks. Confirming that this works as expected (after manually changing test_accents.mbox to make the arc unit output fail)

I also tested by feeding some emails from my collection of broken test emails (it's sometimes useful to be a GNOME Evolution docs maintainer) into ./scripts/mail/mail_handler.php after editing mail_handler.php to also include print $headers['from']; print "\n"; print $headers['subject']; print "\n";

This revision is now accepted and ready to land.Dec 3 2024, 22:24
src/applications/metamta/externals/__tests__/data/test_accents.mbox
26

Thanks for the question. This phrase in Italian means:

Great!!! It is now(äää) time for review. Yeah bro.