Added meta files (#195)

* Added meta files

* Style fixes from StyleCI
This commit is contained in:
Tobias Nyholm 2016-10-15 02:20:46 +02:00 committed by Sean Johnson
parent fb377f7257
commit 043658f996
15 changed files with 106 additions and 46 deletions

9
.editorconfig Normal file
View 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
View 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
View 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
View 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
View 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

View File

@ -54,6 +54,7 @@ class RestClient
* If we should use SSL or not.
*
* @var bool
*
* @deprecated To be removed in 3.0
*/
protected $sslEnabled = true;
@ -130,7 +131,7 @@ class RestClient
$fileIndex = 0;
foreach ($files[$fieldName] as $file) {
$postFiles[] = $this->prepareFile($fieldName, $file, $fileIndex);
$fileIndex++;
++$fileIndex;
}
} else {
$postFiles[] = $this->prepareFile($fieldName, $files[$fieldName]);
@ -352,6 +353,7 @@ class RestClient
* @param bool $sslEnabled
*
* @return RestClient
*
* @deprecated To be removed in 3.0
*/
public function setSslEnabled($sslEnabled)

View File

@ -173,6 +173,7 @@ class Mailgun
* @param bool $sslEnabled
*
* @return Mailgun
*
* @deprecated This will be removed in 3.0. Mailgun does not support non-secure connections to their API.
*/
public function setSslEnabled($sslEnabled)

View File

@ -103,7 +103,7 @@ class BatchMessageTest extends \Mailgun\Tests\MailgunTestCase
public function testAddMultipleBatchRecipients()
{
$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"]);
}
$messageObj = $message->getMessage();
@ -116,7 +116,7 @@ class BatchMessageTest extends \Mailgun\Tests\MailgunTestCase
$message->setFromAddress('samples@mailgun.org', ['first' => 'Test', 'last' => 'User']);
$message->setSubject('This is the subject 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"]);
}
$messageObj = $message->getMessage();

View File

@ -84,27 +84,27 @@ class ComplexMessageTest extends \Mailgun\Tests\MailgunTestCase
foreach ($result->files as $file) {
if ($file['name'] == 'to') {
$this->assertEquals($file['contents'], 'test@test.mailgun.org');
$testCount++;
++$testCount;
}
if ($file['name'] == 'from') {
$this->assertEquals($file['contents'], 'sender@test.mailgun.org');
$testCount++;
++$testCount;
}
if ($file['name'] == 'subject') {
$this->assertEquals($file['contents'], 'This is my test subject');
$testCount++;
++$testCount;
}
if ($file['name'] == 'text') {
$this->assertEquals($file['contents'], 'Testing!');
$testCount++;
++$testCount;
}
if ($file['name'] == 'inline[0]') {
$this->assertEquals($file['filename'], 'mailgun_icon1.png');
$testCount++;
++$testCount;
}
if ($file['name'] == 'inline[1]') {
$this->assertEquals($file['filename'], 'mailgun_icon2.png');
$testCount++;
++$testCount;
}
}