ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
NativeMailerHandlerTest.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of the Monolog package.
5 *
6 * (c) Jordi Boggiano <j.boggiano@seld.be>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace Monolog\Handler;
13
15
17{
22 {
23 $mailer = new NativeMailerHandler('spammer@example.org', 'dear victim', "receiver@example.org\r\nFrom: faked@attacker.org");
24 }
25
29 public function testSetterHeaderInjection()
30 {
31 $mailer = new NativeMailerHandler('spammer@example.org', 'dear victim', 'receiver@example.org');
32 $mailer->addHeader("Content-Type: text/html\r\nFrom: faked@attacker.org");
33 }
34
39 {
40 $mailer = new NativeMailerHandler('spammer@example.org', 'dear victim', 'receiver@example.org');
41 $mailer->addHeader(array("Content-Type: text/html\r\nFrom: faked@attacker.org"));
42 }
43
48 {
49 $mailer = new NativeMailerHandler('spammer@example.org', 'dear victim', 'receiver@example.org');
50 $mailer->setContentType("text/html\r\nFrom: faked@attacker.org");
51 }
52
57 {
58 $mailer = new NativeMailerHandler('spammer@example.org', 'dear victim', 'receiver@example.org');
59 $mailer->setEncoding("utf-8\r\nFrom: faked@attacker.org");
60 }
61}
testSetterContentTypeInjection()
@expectedException InvalidArgumentException
testSetterEncodingInjection()
@expectedException InvalidArgumentException
testSetterHeaderInjection()
@expectedException InvalidArgumentException
testConstructorHeaderInjection()
@expectedException InvalidArgumentException
testSetterArrayHeaderInjection()
@expectedException InvalidArgumentException
NativeMailerHandler uses the mail() function to send the emails.