File tree Expand file tree Collapse file tree 3 files changed +36
-31
lines changed Expand file tree Collapse file tree 3 files changed +36
-31
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ public function profile($config = null) {
195
195
196
196
/**
197
197
* Overwrite to allow mimetype detection
198
- +
198
+ *
199
199
* @param string|array $attachments String with the filename or array with filenames
200
200
* @return $this
201
201
* @throws \InvalidArgumentException
@@ -564,7 +564,7 @@ public function send($message = null) {
564
564
'transport ' => get_class ($ this ->_transport ),
565
565
];
566
566
567
- /** @deprecated Since CakePHP 3.4.0-RC4 in core * */
567
+ /* @deprecated Since CakePHP 3.4.0-RC4 in core */
568
568
if ($ this ->_priority ) {
569
569
$ this ->_headers ['X-Priority ' ] = $ this ->_priority ;
570
570
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+ namespace TestApp \Mailer ;
3
+
4
+ use Tools \Mailer \Email ;
5
+
6
+ /**
7
+ * Help to test Email
8
+ */
9
+ class TestEmail extends Email {
10
+
11
+ /**
12
+ * Wrap to protected method
13
+ *
14
+ * @param string $text
15
+ * @param int $length
16
+ * @return array
17
+ */
18
+ public function wrap ($ text , $ length = Email::LINE_LENGTH_MUST ) {
19
+ return parent ::_wrap ($ text , $ length );
20
+ }
21
+
22
+ /**
23
+ * @param string $attribute
24
+ * @return mixed
25
+ */
26
+ public function getProtected ($ attribute ) {
27
+ $ attribute = '_ ' . $ attribute ;
28
+ return $ this ->$ attribute ;
29
+ }
30
+
31
+ }
Original file line number Diff line number Diff line change 5
5
use Cake \Core \Configure ;
6
6
use Cake \Core \Plugin ;
7
7
use Cake \Log \Log ;
8
+ use TestApp \Mailer \TestEmail ;
8
9
use Tools \Mailer \Email ;
9
10
use Tools \TestSuite \TestCase ;
10
11
14
15
class EmailTest extends TestCase {
15
16
16
17
/**
17
- * @var TestEmail
18
+ * @var \TestApp\Mailer\ TestEmail
18
19
*/
19
20
protected $ Email ;
20
21
@@ -82,7 +83,7 @@ public function testFrom() {
82
83
$ this ->assertSame ($ expected , $ this ->Email ->from ());
83
84
$ this ->assertSame ($ this ->Email , $ result );
84
85
85
- $ this ->expectException ('InvalidArgumentException ' );
86
+ $ this ->setExpectedException ('InvalidArgumentException ' );
86
87
$ this ->
Email ->
from ([
'[email protected] ' =>
'CakePHP ' ,
'[email protected] ' =>
'From can only be one address ' ]);
87
88
}
88
89
@@ -432,30 +433,3 @@ public function testWrapCustomized() {
432
433
}
433
434
434
435
}
435
-
436
- /**
437
- * Help to test Email
438
- */
439
- class TestEmail extends Email {
440
-
441
- /**
442
- * Wrap to protected method
443
- *
444
- * @param string $text
445
- * @param int $length
446
- * @return array
447
- */
448
- public function wrap ($ text , $ length = Email::LINE_LENGTH_MUST ) {
449
- return parent ::_wrap ($ text , $ length );
450
- }
451
-
452
- /**
453
- * @param string $attribute
454
- * @return mixed
455
- */
456
- public function getProtected ($ attribute ) {
457
- $ attribute = '_ ' . $ attribute ;
458
- return $ this ->$ attribute ;
459
- }
460
-
461
- }
You can’t perform that action at this time.
0 commit comments