Server IP : 184.154.167.98 / Your IP : 18.119.112.208 Web Server : Apache System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 User : puertode ( 1767) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/puertode/www/mesa/setup/test/tests/ |
Upload File : |
<?php require_once 'mockdb.php'; require_once INCLUDE_DIR.'class.validator.php'; require_once INCLUDE_DIR.'class.auth.php'; require_once INCLUDE_DIR.'class.staff.php'; require_once INCLUDE_DIR.'class.email.php'; require_once INCLUDE_DIR.'class.format.php'; require_once INCLUDE_DIR.'class.thread.php'; class TestMailParsing extends Test { var $name = "Mail parsing library tests"; function testRecipients() { db_connect(new MockDbSource()); $email = <<<EOF Delivered-To: jared@osticket.com Received: by 10.60.55.168 with SMTP id t8csp161432oep; Fri, 7 Feb 2014 22:11:19 -0800 (PST) X-Received: by 10.182.18.9 with SMTP id s9mr16356699obd.15.1391839879167; Fri, 07 Feb 2014 22:11:19 -0800 (PST) Return-Path: <mailer@greezybacon.supportsystem.com> To: jared@osticket.com Subject: =?utf-8?Q?System_test_email_=C2=AE?= Content-Type: multipart/alternative; boundary="=_28022448a1f58a3af7edf57ff2e3af44" From: "Support" <help@supportsystem.com> Date: Sat, 08 Feb 2014 01:11:18 -0500 Message-ID: <Syke6-g24hwuTu77-help@supportsystem.com> MIME-Version: 1.0 --=_28022448a1f58a3af7edf57ff2e3af44 Content-Transfer-Encoding: base64 Content-Type: text/plain; charset=utf-8 Q2hlZXJzISE= --=_28022448a1f58a3af7edf57ff2e3af44 Content-Transfer-Encoding: base64 Content-Type: text/html; charset=utf-8 Q2hlZXJzISE= --=_28022448a1f58a3af7edf57ff2e3af44-- EOF; $parser = new EmailDataParser(); $result = $parser->parse($email); $this->assert(count($result['recipients']) == 1, 'Expected 1 recipient'); $this->assert($result['recipients'][0]['source'] == 'delivered-to', 'Delivered-To header used as a collaborator'); } } return 'TestMailParsing'; ?>