mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Added in test for smtp functionality for email component, test not complete
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5347 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
5913b5d21e
commit
32ac42c055
1 changed files with 36 additions and 0 deletions
36
cake/tests/cases/libs/controller/components/email.test.php
Normal file
36
cake/tests/cases/libs/controller/components/email.test.php
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
<?php
|
||||||
|
/* SVN FILE: $Id$ */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Series of tests for email component
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once LIBS . '/controller/components/email.php';
|
||||||
|
|
||||||
|
class EmailTestController extends Controller {
|
||||||
|
var $name = 'EmailTest';
|
||||||
|
var $uses = null;
|
||||||
|
var $components = array('Email');
|
||||||
|
}
|
||||||
|
|
||||||
|
class EmailTest extends CakeTestCase {
|
||||||
|
var $name = 'Email';
|
||||||
|
|
||||||
|
function setUp() {
|
||||||
|
$this->Controller =& new Controller();
|
||||||
|
$this->Controller->_initComponents();
|
||||||
|
$this->View =& new View($this->Controller);
|
||||||
|
ClassRegistry::addObject('view', $this->View);
|
||||||
|
}
|
||||||
|
|
||||||
|
function testConstruction() {
|
||||||
|
$this->assertTrue(is_object($this->Email));
|
||||||
|
}
|
||||||
|
|
||||||
|
function testBadSmtpSent() {
|
||||||
|
$this->Controller->Email->smtpOptions['host'] = 'caketest.com';
|
||||||
|
$this->Controller->Email->delivery = 'smtp';
|
||||||
|
$this->assertFalse($this->Email->send('This should not work'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
Loading…
Add table
Reference in a new issue