mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2025-02-06 00:09:24 +03:00
parent
fb377f7257
commit
043658f996
9
.editorconfig
Normal file
9
.editorconfig
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
15
.gitattributes
vendored
Normal file
15
.gitattributes
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
.editorconfig export-ignore
|
||||||
|
.gitattributes export-ignore
|
||||||
|
/.github/ export-ignore
|
||||||
|
.gitignore export-ignore
|
||||||
|
/.php_cs export-ignore
|
||||||
|
/.scrutinizer.yml export-ignore
|
||||||
|
/.styleci.yml export-ignore
|
||||||
|
/.travis.yml export-ignore
|
||||||
|
/behat.yml.dist export-ignore
|
||||||
|
/features/ export-ignore
|
||||||
|
/phpspec.ci.yml export-ignore
|
||||||
|
/phpspec.yml.dist export-ignore
|
||||||
|
/phpunit.xml.dist export-ignore
|
||||||
|
/spec/ export-ignore
|
||||||
|
/tests/ export-ignore
|
13
.php_cs
Normal file
13
.php_cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* In order to make it work, fabpot/php-cs-fixer and sllh/php-cs-fixer-styleci-bridge must be installed globally
|
||||||
|
* with composer.
|
||||||
|
*
|
||||||
|
* @link https://github.com/Soullivaneuh/php-cs-fixer-styleci-bridge
|
||||||
|
* @link https://github.com/FriendsOfPHP/PHP-CS-Fixer
|
||||||
|
*/
|
||||||
|
|
||||||
|
use SLLH\StyleCIBridge\ConfigBridge;
|
||||||
|
|
||||||
|
return ConfigBridge::create();
|
8
.scrutinizer.yml
Normal file
8
.scrutinizer.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
filter:
|
||||||
|
paths: [src/*]
|
||||||
|
checks:
|
||||||
|
php:
|
||||||
|
code_rating: true
|
||||||
|
duplication: true
|
||||||
|
tools:
|
||||||
|
external_code_coverage: true
|
12
.styleci.yml
Normal file
12
.styleci.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
preset: symfony
|
||||||
|
|
||||||
|
finder:
|
||||||
|
path:
|
||||||
|
- "src"
|
||||||
|
- "tests"
|
||||||
|
|
||||||
|
enabled:
|
||||||
|
- short_array_syntax
|
||||||
|
|
||||||
|
disabled:
|
||||||
|
- phpdoc_annotation_without_dot # This is still buggy: https://github.com/symfony/symfony/pull/19198
|
@ -54,6 +54,7 @@ class RestClient
|
|||||||
* If we should use SSL or not.
|
* If we should use SSL or not.
|
||||||
*
|
*
|
||||||
* @var bool
|
* @var bool
|
||||||
|
*
|
||||||
* @deprecated To be removed in 3.0
|
* @deprecated To be removed in 3.0
|
||||||
*/
|
*/
|
||||||
protected $sslEnabled = true;
|
protected $sslEnabled = true;
|
||||||
@ -130,7 +131,7 @@ class RestClient
|
|||||||
$fileIndex = 0;
|
$fileIndex = 0;
|
||||||
foreach ($files[$fieldName] as $file) {
|
foreach ($files[$fieldName] as $file) {
|
||||||
$postFiles[] = $this->prepareFile($fieldName, $file, $fileIndex);
|
$postFiles[] = $this->prepareFile($fieldName, $file, $fileIndex);
|
||||||
$fileIndex++;
|
++$fileIndex;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$postFiles[] = $this->prepareFile($fieldName, $files[$fieldName]);
|
$postFiles[] = $this->prepareFile($fieldName, $files[$fieldName]);
|
||||||
@ -352,6 +353,7 @@ class RestClient
|
|||||||
* @param bool $sslEnabled
|
* @param bool $sslEnabled
|
||||||
*
|
*
|
||||||
* @return RestClient
|
* @return RestClient
|
||||||
|
*
|
||||||
* @deprecated To be removed in 3.0
|
* @deprecated To be removed in 3.0
|
||||||
*/
|
*/
|
||||||
public function setSslEnabled($sslEnabled)
|
public function setSslEnabled($sslEnabled)
|
||||||
|
@ -173,6 +173,7 @@ class Mailgun
|
|||||||
* @param bool $sslEnabled
|
* @param bool $sslEnabled
|
||||||
*
|
*
|
||||||
* @return Mailgun
|
* @return Mailgun
|
||||||
|
*
|
||||||
* @deprecated This will be removed in 3.0. Mailgun does not support non-secure connections to their API.
|
* @deprecated This will be removed in 3.0. Mailgun does not support non-secure connections to their API.
|
||||||
*/
|
*/
|
||||||
public function setSslEnabled($sslEnabled)
|
public function setSslEnabled($sslEnabled)
|
||||||
|
@ -103,7 +103,7 @@ class BatchMessageTest extends \Mailgun\Tests\MailgunTestCase
|
|||||||
public function testAddMultipleBatchRecipients()
|
public function testAddMultipleBatchRecipients()
|
||||||
{
|
{
|
||||||
$message = $this->client->BatchMessage($this->sampleDomain);
|
$message = $this->client->BatchMessage($this->sampleDomain);
|
||||||
for ($i = 0; $i < 100; $i++) {
|
for ($i = 0; $i < 100; ++$i) {
|
||||||
$message->addToRecipient("$i@samples.mailgun.org", ['first' => 'Test', 'last' => "User $i"]);
|
$message->addToRecipient("$i@samples.mailgun.org", ['first' => 'Test', 'last' => "User $i"]);
|
||||||
}
|
}
|
||||||
$messageObj = $message->getMessage();
|
$messageObj = $message->getMessage();
|
||||||
@ -116,7 +116,7 @@ class BatchMessageTest extends \Mailgun\Tests\MailgunTestCase
|
|||||||
$message->setFromAddress('samples@mailgun.org', ['first' => 'Test', 'last' => 'User']);
|
$message->setFromAddress('samples@mailgun.org', ['first' => 'Test', 'last' => 'User']);
|
||||||
$message->setSubject('This is the subject of the message!');
|
$message->setSubject('This is the subject of the message!');
|
||||||
$message->setTextBody('This is the text body of the message!');
|
$message->setTextBody('This is the text body of the message!');
|
||||||
for ($i = 0; $i < 1001; $i++) {
|
for ($i = 0; $i < 1001; ++$i) {
|
||||||
$message->addToRecipient("$i@samples.mailgun.org", ['first' => 'Test', 'last' => "User $i"]);
|
$message->addToRecipient("$i@samples.mailgun.org", ['first' => 'Test', 'last' => "User $i"]);
|
||||||
}
|
}
|
||||||
$messageObj = $message->getMessage();
|
$messageObj = $message->getMessage();
|
||||||
|
@ -84,27 +84,27 @@ class ComplexMessageTest extends \Mailgun\Tests\MailgunTestCase
|
|||||||
foreach ($result->files as $file) {
|
foreach ($result->files as $file) {
|
||||||
if ($file['name'] == 'to') {
|
if ($file['name'] == 'to') {
|
||||||
$this->assertEquals($file['contents'], 'test@test.mailgun.org');
|
$this->assertEquals($file['contents'], 'test@test.mailgun.org');
|
||||||
$testCount++;
|
++$testCount;
|
||||||
}
|
}
|
||||||
if ($file['name'] == 'from') {
|
if ($file['name'] == 'from') {
|
||||||
$this->assertEquals($file['contents'], 'sender@test.mailgun.org');
|
$this->assertEquals($file['contents'], 'sender@test.mailgun.org');
|
||||||
$testCount++;
|
++$testCount;
|
||||||
}
|
}
|
||||||
if ($file['name'] == 'subject') {
|
if ($file['name'] == 'subject') {
|
||||||
$this->assertEquals($file['contents'], 'This is my test subject');
|
$this->assertEquals($file['contents'], 'This is my test subject');
|
||||||
$testCount++;
|
++$testCount;
|
||||||
}
|
}
|
||||||
if ($file['name'] == 'text') {
|
if ($file['name'] == 'text') {
|
||||||
$this->assertEquals($file['contents'], 'Testing!');
|
$this->assertEquals($file['contents'], 'Testing!');
|
||||||
$testCount++;
|
++$testCount;
|
||||||
}
|
}
|
||||||
if ($file['name'] == 'inline[0]') {
|
if ($file['name'] == 'inline[0]') {
|
||||||
$this->assertEquals($file['filename'], 'mailgun_icon1.png');
|
$this->assertEquals($file['filename'], 'mailgun_icon1.png');
|
||||||
$testCount++;
|
++$testCount;
|
||||||
}
|
}
|
||||||
if ($file['name'] == 'inline[1]') {
|
if ($file['name'] == 'inline[1]') {
|
||||||
$this->assertEquals($file['filename'], 'mailgun_icon2.png');
|
$this->assertEquals($file['filename'], 'mailgun_icon2.png');
|
||||||
$testCount++;
|
++$testCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user