Created
August 1, 2011 15:52
-
-
Save splittingred/1118403 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* MODX Revolution | |
* | |
* Copyright 2006-2011 by MODX, LLC. | |
* All rights reserved. | |
* | |
* This program is free software; you can redistribute it and/or modify it under | |
* the terms of the GNU General Public License as published by the Free Software | |
* Foundation; either version 2 of the License, or (at your option) any later | |
* version. | |
* | |
* This program is distributed in the hope that it will be useful, but WITHOUT | |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | |
* details. | |
* | |
* You should have received a copy of the GNU General Public License along with | |
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple | |
* Place, Suite 330, Boston, MA 02111-1307 USA | |
* | |
* @package modx-test | |
*/ | |
/** | |
* Tests related to the modMail class. | |
* | |
* @package modx-test | |
* @subpackage modx | |
* @group Model | |
* @group Mail | |
* @group modMail | |
*/ | |
class modMailTest extends MODxTestCase { | |
/** | |
* @var modMail|PHPUnit_Framework_MockObject_MockObject $mail | |
*/ | |
public $mail; | |
public function setUp() { | |
parent::setUp(); | |
$this->modx->loadClass('mail.modMail',MODX_CORE_PATH.'model/modx/',true,true); | |
$this->mail = $this->getMockForAbstractClass('modMail',array(&$this->modx)); | |
$this->mail->expects($this->any()) | |
->method('_getMailer') | |
->will($this->returnValue(true)); | |
} | |
/** | |
* @param string $k | |
* @param mixed $v | |
* @dataProvider providerSet | |
*/ | |
public function testSet($k,$v) { | |
$this->mail->set($k,$v); | |
$this->assertEquals($v,$this->mail->attributes[$k]); | |
} | |
/** | |
* @return array | |
*/ | |
public function providerSet() { | |
return array( | |
array('mail_use_smtp',false), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment