File tree Expand file tree Collapse file tree 2 files changed +48
-1
lines changed
tests/TestCase/Mailer/Transport Expand file tree Collapse file tree 2 files changed +48
-1
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ sudo: false
99
1010env :
1111 global :
12- - DEFAULT=0
12+ - DEFAULT=1
1313
1414matrix :
1515 fast_finish : true
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Elastic Email Plugin for CakePHP 3
4+ * Copyright (c) PNG Labz (https://www.pnglabz.com)
5+ *
6+ * Licensed under The MIT License
7+ * For full copyright and license information, please see the LICENSE.md
8+ * Redistributions of files must retain the above copyright notice.
9+ *
10+ * @copyright Copyright (c) PNG Labz (https://www.pnglabz.com)
11+ * @license https://opensource.org/licenses/mit-license.php MIT License
12+ * @link https://github.com/pnglabz/cakephp-elastic-email
13+ * @since 1.0.0
14+ */
15+ namespace ElasticEmail \Test \TestCase \Mailer \Transport ;
16+
17+ use Cake \Mailer \Email ;
18+ use Cake \TestSuite \TestCase ;
19+
20+ class ElasticEmailTransportTest extends TestCase
21+ {
22+ public function setUp ()
23+ {
24+ parent ::setUp ();
25+ }
26+
27+ public function testMissingApiKey ()
28+ {
29+ $ this ->expectException ('ElasticEmail\Mailer\Exception\MissingElasticEmailApiKeyException ' );
30+
31+ Email::setConfigTransport (
32+ 'elasticemail ' ,
33+ [
34+ 'className ' => 'ElasticEmail.ElasticEmail ' ,
35+ 'apiKey ' => ''
36+ ]
37+ );
38+
39+ $ email = new Email ();
40+ $ email ->setProfile (['transport ' => 'elasticemail ' ]);
41+ $ email ->setFrom (['from@example.com ' => 'CakePHP Elastic Email ' ])
42+ ->setTo ('to@example.com ' )
43+ ->setEmailFormat ('both ' )
44+ ->setSubject ('{title} - Email from CakePHP Elastic Email plugin ' )
45+ ->send ('Hello {firstname} {lastname}, <br> This is an email from CakePHP Elastic Email plugin. ' );
46+ }
47+ }
You can’t perform that action at this time.
0 commit comments