ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMailTest Class Reference

Unit tests for the mail system. More...

+ Inheritance diagram for ilMailTest:
+ Collaboration diagram for ilMailTest:

Public Member Functions

 testEmpty ()
 testIdentifiedUserIsSender ()
 testMissingNoReplyAddressAutogenerated ()
 testInvalidNoReplyAddressAutogenerated ()
 testValidNoReplyAddressAutogenerated ()

Protected Member Functions

 setUp ()

Protected Attributes

 $backupGlobals = false

Detailed Description

Unit tests for the mail system.

Version
$Id$
Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de

Definition at line 14 of file ilMailTest.php.

Member Function Documentation

ilMailTest::setUp ( )
protected

Definition at line 18 of file ilMailTest.php.

References ilUnitUtil\performInitialisation().

{
include_once 'Services/PHPUnit/classes/class.ilUnitUtil.php';
}

+ Here is the call graph for this function:

ilMailTest::testEmpty ( )

Definition at line 24 of file ilMailTest.php.

{
$this->assertEquals('foo', 'foo');
}
ilMailTest::testIdentifiedUserIsSender ( )

Definition at line 29 of file ilMailTest.php.

References ilMimeMail\_mimeEncode(), and ilMail\getMimeMailSender().

{
global $ilUser;
$mail = new ilMail($ilUser->getId());
$sender = $mail->getMimeMailSender();
$this->assertEquals($sender, ilMimeMail::_mimeEncode($ilUser->getFullname()).'<'.$ilUser->getEmail().'>');
}

+ Here is the call graph for this function:

ilMailTest::testInvalidNoReplyAddressAutogenerated ( )

Definition at line 55 of file ilMailTest.php.

References $ilSetting, ilMail\_getAnonymousName(), and ilMimeMail\_mimeEncode().

{
global $ilSetting;
$tmp = $ilSetting->get('mail_external_sender_noreply');
$ilSetting->set('mail_external_sender_noreply', 'host.de');
$mail = new ilMail(ANONYMOUS_USER_ID);
$sender = $mail->getMimeMailSender();
$ilSetting->set('mail_external_sender_noreply', $tmp);
$this->assertEquals($sender, ilMimeMail::_mimeEncode(ilMail::_getAnonymousName()).'<noreply@host.de>');
}

+ Here is the call graph for this function:

ilMailTest::testMissingNoReplyAddressAutogenerated ( )

Definition at line 39 of file ilMailTest.php.

References $ilSetting, ilMail\_getAnonymousName(), and ilMimeMail\_mimeEncode().

{
global $ilSetting;
$tmp = $ilSetting->get('mail_external_sender_noreply');
$ilSetting->set('mail_external_sender_noreply', '');
$mail = new ilMail(ANONYMOUS_USER_ID);
$sender = $mail->getMimeMailSender();
$ilSetting->set('mail_external_sender_noreply', $tmp);
$this->assertEquals($sender, ilMimeMail::_mimeEncode(ilMail::_getAnonymousName()).'<noreply@'.$_SERVER['SERVER_NAME'].'>');
}

+ Here is the call graph for this function:

ilMailTest::testValidNoReplyAddressAutogenerated ( )

Definition at line 71 of file ilMailTest.php.

References $ilSetting, ilMail\_getAnonymousName(), and ilMimeMail\_mimeEncode().

{
global $ilSetting;
$tmp = $ilSetting->get('mail_external_sender_noreply');
$ilSetting->set('mail_external_sender_noreply', 'doNotReply@host.de');
$mail = new ilMail(ANONYMOUS_USER_ID);
$sender = $mail->getMimeMailSender();
$ilSetting->set('mail_external_sender_noreply', $tmp);
$this->assertEquals($sender, ilMimeMail::_mimeEncode(ilMail::_getAnonymousName()).'<doNotReply@host.de>');
}

+ Here is the call graph for this function:

Field Documentation

ilMailTest::$backupGlobals = false
protected

Definition at line 16 of file ilMailTest.php.


The documentation for this class was generated from the following file: