Drupal 8  8.0.2
MailHandlerTest Class Reference
Inheritance diagram for MailHandlerTest:

Public Member Functions

 testInvalidRecipient ()
 
 testSendMailMessages (MessageInterface $message, AccountInterface $sender, $results)
 
 getSendMailMessages ()
 
- Public Member Functions inherited from UnitTestCase
 randomMachineName ($length=8)
 
 getConfigFactoryStub (array $configs=array())
 
 getConfigStorageStub (array $configs)
 
 getStringTranslationStub ()
 

Protected Member Functions

 setUp ()
 
 getMockSender ($anonymous=TRUE, $mail_address= 'anonymous @drupal.org')
 
 getAnonymousMockMessage ($recipients, $auto_reply, $copy_sender=FALSE)
 
 getAuthenticatedMockMessage ($copy_sender=FALSE)
 
 getMockContactForm ($recipients, $auto_reply)
 
- Protected Member Functions inherited from UnitTestCase
 setUp ()
 
 getRandomGenerator ()
 
 assertArrayEquals (array $expected, array $actual, $message=NULL)
 
 getBlockMockWithMachineName ($machine_name)
 
 getContainerWithCacheTagsInvalidator (CacheTagsInvalidatorInterface $cache_tags_validator)
 
 getClassResolverStub ()
 

Protected Attributes

 $languageManager
 
 $logger
 
 $mailManager
 
 $contactMailHandler
 
 $contactForm
 
 $entityManager
 
 $userStorage
 
- Protected Attributes inherited from UnitTestCase
 $randomGenerator
 
 $root
 

Detailed Description

contact

Member Function Documentation

getAnonymousMockMessage (   $recipients,
  $auto_reply,
  $copy_sender = FALSE 
)
protected

Builds a mock message from anonymous user.

Parameters
array$recipientsAn array of recipient email addresses.
bool$auto_replyTRUE if auto reply is enable.
bool$copy_senderTRUE if a copy should be sent, FALSE if not.
Returns
| Mock message for testing.

References MailHandlerTest\getMockContactForm().

Referenced by MailHandlerTest\getSendMailMessages().

Here is the call graph for this function:

Here is the caller graph for this function:

getAuthenticatedMockMessage (   $copy_sender = FALSE)
protected

Builds a mock message from authenticated user.

Parameters
bool$copy_senderTRUE if a copy should be sent, FALSE if not.
Returns
| Mock message for testing.

References MailHandlerTest\getMockContactForm().

Referenced by MailHandlerTest\getSendMailMessages().

Here is the call graph for this function:

Here is the caller graph for this function:

getMockContactForm (   $recipients,
  $auto_reply 
)
protected

Builds a mock message on given scenario.

Parameters
array$recipientsAn array of recipient email addresses.
string$auto_replyAn auto-reply message to send to the message author.
Returns
| Mock message for testing.

Referenced by MailHandlerTest\getAnonymousMockMessage(), and MailHandlerTest\getAuthenticatedMockMessage().

Here is the caller graph for this function:

getMockSender (   $anonymous = TRUE,
  $mail_address = 'anonymous@drupal.org' 
)
protected

Builds a mock sender on given scenario.

Parameters
bool$anonymousTRUE if the sender is anonymous.
string$mail_addressThe mail address of the user.
Returns
| Mock sender for testing.

Referenced by MailHandlerTest\getSendMailMessages().

Here is the caller graph for this function:

getSendMailMessages ( )

Data provider for ::testSendMailMessages.

References MailHandlerTest\getAnonymousMockMessage(), MailHandlerTest\getAuthenticatedMockMessage(), and MailHandlerTest\getMockSender().

Here is the call graph for this function:

setUp ( )
protected

{}

References Drupal\entityManager(), UnitTestCase\getStringTranslationStub(), Drupal\languageManager(), and Drupal\logger().

Here is the call graph for this function:

testInvalidRecipient ( )

Tests the children() method with an invalid key.

Unable to determine message recipient

::sendMailMessages

testSendMailMessages ( MessageInterface  $message,
AccountInterface  $sender,
  $results 
)

Tests the sendMailMessages method.

getSendMailMessages

::sendMailMessages

References UnitTestCase\assertArrayEquals(), and Drupal\logger().

Here is the call graph for this function:


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