|
|
@@ -857,7 +857,7 @@ class EmailTest extends TestCase
|
|
|
*
|
|
|
* @return void
|
|
|
*/
|
|
|
- public function testAttachments()
|
|
|
+ public function testSetAttachments()
|
|
|
{
|
|
|
$this->Email->setAttachments(CAKE . 'basics.php');
|
|
|
$expected = [
|
|
|
@@ -892,6 +892,26 @@ class EmailTest extends TestCase
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Test send() with no template and data string attachment and no mimetype
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function testSetAttachmentDataNoMimetype()
|
|
|
+ {
|
|
|
+ $this->Email->setAttachments(['cake.icon.gif' => [
|
|
|
+ 'data' => 'test',
|
|
|
+ ]]);
|
|
|
+ $result = $this->Email->getAttachments();
|
|
|
+ $expected = [
|
|
|
+ 'cake.icon.gif' => [
|
|
|
+ 'data' => base64_encode('test') . "\r\n",
|
|
|
+ 'mimetype' => 'application/octet-stream'
|
|
|
+ ],
|
|
|
+ ];
|
|
|
+ $this->assertSame($expected, $this->Email->getAttachments());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* testTransport method
|
|
|
*
|
|
|
* @return void
|
|
|
@@ -1317,7 +1337,6 @@ class EmailTest extends TestCase
|
|
|
*
|
|
|
* @return void
|
|
|
*/
|
|
|
-
|
|
|
public function testSendNoTemplateWithDataStringAttachment()
|
|
|
{
|
|
|
$this->Email->setTransport('debug');
|