本文整理汇总了PHP中JFactory::mailer方法的典型用法代码示例。如果您正苦于以下问题:PHP JFactory::mailer方法的具体用法?PHP JFactory::mailer怎么用?PHP JFactory::mailer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JFactory
的用法示例。
在下文中一共展示了JFactory::mailer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: restoreFactoryState
/**
* Sets the Factory pointers
*
* @return void
*/
protected function restoreFactoryState()
{
\JFactory::$application = $this->savedFactoryState['application'];
\JFactory::$config = $this->savedFactoryState['config'];
\JFactory::$dates = $this->savedFactoryState['dates'];
\JFactory::$session = $this->savedFactoryState['session'];
\JFactory::$language = $this->savedFactoryState['language'];
\JFactory::$document = $this->savedFactoryState['document'];
\JFactory::$acl = $this->savedFactoryState['acl'];
\JFactory::$database = $this->savedFactoryState['database'];
\JFactory::$mailer = $this->savedFactoryState['mailer'];
}
示例2: getMailer
/**
* Get a mailer object.
*
* Returns the global {@link JMail} object, only creating it if it doesn't already exist.
*
* @return JMail object
*
* @see JMail
* @since 11.1
*/
public static function getMailer()
{
if (!self::$mailer) {
self::$mailer = self::createMailer();
}
$copy = clone self::$mailer;
return $copy;
}
示例3: getMailer
/**
* Get a mailer object
*
* Returns the global {@link JMail} object, only creating it
* if it doesn't already exist
*
* @return object JMail
*/
public static function getMailer()
{
if (!is_object(JFactory::$mailer)) {
JFactory::$mailer = JFactory::_createMailer();
}
$copy = clone JFactory::$mailer;
return $copy;
}
示例4: testSendAdminMail
/**
* Testing sendAdminMail().
*
* @param array Arguments for method call
* @param array Arguments received by method
* @param bool Expected return from call
*
* @return void
*
* @dataProvider casesSendAdminMail
*/
public function testSendAdminMail($args, $expectedArgs, $expResult)
{
$mockMailer = $this->getMock('JMail', array('sendAdminMail'));
$mockMailer->expects($this->once())->method('sendAdminMail')->with($this->equalTo($expectedArgs['adminName']), $this->equalTo($expectedArgs['adminEmail']), $this->equalTo($expectedArgs['email']), $this->equalTo($expectedArgs['type']), $this->equalTo($expectedArgs['title']), $this->equalTo($expectedArgs['author']), $this->equalTo($expectedArgs['url']))->will($this->returnValue($expResult));
JFactory::$mailer = $mockMailer;
$this->assertThat(JUtility::sendAdminMail($args['adminName'], $args['adminEmail'], $args['email'], $args['type'], $args['title'], $args['author'], $args['url']), $this->equalTo($expResult));
}