@@ -76,6 +76,9 @@ function setHeaders($headers) {
76
76
* @return array
77
77
*/
78
78
function getHeaders () {
79
+ if (empty ($ this ->_header )) {
80
+ return array ();
81
+ }
79
82
return $ this ->__header ;
80
83
}
81
84
@@ -96,6 +99,9 @@ function setBoundary() {
96
99
* @return string
97
100
*/
98
101
function getBoundary () {
102
+ if (empty ($ this ->__boundary )) {
103
+ return null ;
104
+ }
99
105
return $ this ->__boundary ;
100
106
}
101
107
@@ -106,6 +112,9 @@ function getBoundary() {
106
112
* @return string
107
113
*/
108
114
function getMessage () {
115
+ if (empty ($ this ->__message )) {
116
+ return array ();
117
+ }
109
118
return $ this ->__message ;
110
119
}
111
120
@@ -195,11 +204,9 @@ function setUp() {
195
204
$ this ->_appEncoding = Configure::read ('App.encoding ' );
196
205
Configure::write ('App.encoding ' , 'UTF-8 ' );
197
206
198
- $ this ->Controller =& new EmailTestController ();
207
+ $ this ->Controller = new EmailTestController ();
199
208
200
- restore_error_handler ();
201
- @$ this ->Controller ->Component ->init ($ this ->Controller );
202
- set_error_handler ('simpleTestErrorHandler ' );
209
+ $ this ->Controller ->Component ->init ($ this ->Controller );
203
210
204
211
$ this ->Controller ->EmailTest ->initialize ($ this ->Controller , array ());
205
212
ClassRegistry::addObject ('view ' , new View ($ this ->Controller ));
@@ -219,7 +226,6 @@ function tearDown() {
219
226
Configure::write ('App.encoding ' , $ this ->_appEncoding );
220
227
App::build ();
221
228
$ this ->Controller ->Session ->delete ('Message ' );
222
- restore_error_handler ();
223
229
ClassRegistry::flush ();
224
230
}
225
231
@@ -545,7 +551,7 @@ function testTemplates() {
545
551
function testSmtpSendSocket () {
546
552
$ this ->skipIf (!@fsockopen ('localhost ' , 25 ), '%s No SMTP server running on localhost ' );
547
553
548
- $ socket =& new CakeSocket (array_merge (array ('protocol ' =>'smtp ' ), $ this ->Controller ->EmailTest ->smtpOptions ));
554
+ $ socket = new CakeSocket (array_merge (array ('protocol ' =>'smtp ' ), $ this ->Controller ->EmailTest ->smtpOptions ));
549
555
$ this ->Controller ->EmailTest ->setConnectionSocket ($ socket );
550
556
551
557
$ this ->assertTrue ($ this ->Controller ->EmailTest ->getConnectionSocket ());
@@ -591,7 +597,7 @@ function testSendDebug() {
591
597
* @return void
592
598
*/
593
599
function testSendDebugWithNoSessions () {
594
- $ session =& $ this ->Controller ->Session ;
600
+ $ session = $ this ->Controller ->Session ;
595
601
unset($ this ->Controller ->Session );
596
602
$ this ->Controller ->EmailTest ->to = 'postmaster@localhost ' ;
597
603
$ this ->Controller ->EmailTest ->from = 'noreply@example.com ' ;
0 commit comments