Commit Graph

78 Commits

Author SHA1 Message Date
Sean Johnson
e177e13a0c Update boundary regex to match RFC1341 (#283)
* Update boundary regex to match RFC1341
2017-02-18 10:53:21 -06:00
David Garcia
1613843c7e Routes API (#249)
* Add initial (empty) Routes PHP Unit Test file

We still need to provide the automated tests

* Add initial Routes file

* Describe API Methods

* Inherit method from TestCase - adding @inheritdoc annotation

* Add new DTOs to map API responses to known objects

* Add new Response to manage the Routes list

* Implement method to retrieve a list of Routes

* Add new Response to manage a single Route resource

* Implement method to retrieve a single Route

* Set ShowResponse as final

* Add new Response to manage the Create process

* Implement method to create a new Route

* Fix missing annotation

* Add new Response to manage the Delete Route process

* Implement method to delete a Route based on the ID

* Add new Response to manage the Update Route process

This response is based on Domain API docs due there are no examples on
Routes API docs. We may need to update the response.

* Implement method to update a Route based on the ID

* Require a $limit value greater than 0

* Require a $skip value greater than or equal to 0

* Set UpdateResponse as final

* Add new (empty) public methods to test the Routes API

* Provide method to get the Routes API from Mailgun Client

* Add missed annotation

* Update ShowResponse to return an instance of ApiResponse instead of the DTO

* Update annotation

* Fix annotation

* Update array $actions to provide an empty array by default

* Update parameters to make sure the last arg always is a DateTime (or null)

* Use empty()

* Remove DTO suffix

* Move DTOs to the parent folder/namespace

* Fix annotations
2016-12-09 14:15:06 -08:00
Sean Johnson
ce8215ff6c Apply fixes from StyleCI (#243) 2016-12-06 12:12:52 -06:00
Tobias Nyholm
61a019ad67 Fixed integration tests (#233)
* Fixed integration tests

* Update integration tests

* cs
2016-11-24 09:59:05 +01:00
Sean Johnson
ce9739ea91 Applied fixes from StyleCI (#228) 2016-11-23 23:02:12 +01:00
Tobias Nyholm
8668b4c222 Updated to use Assert 1.2 (#224) 2016-11-23 23:01:26 +01:00
Tobias Nyholm
9bd6732efd Introduce a request builder. (#217)
* Introduce a request builder.

We inject every dependency (eg RequestFactory and MultipartStreamBuilder) and we do not have to use postMultipart.

* code style

* Use uppercase on http verbs

* Added setters and use getters

* Added tests

* style
2016-11-23 21:55:05 +01:00
Sean Johnson
0da5f410a9 Rename serializer to deserializer (#201) (#216) 2016-11-12 02:50:47 +01:00
Tobias Nyholm
1a71c14097 Removed inheritence, Renamed classes, Mark all classes as final (#212)
* Removed inheritence, Renamed classes, Mark all classes as final

* code style

* Updated docs

* Code style

* Be consistant with the naming of functions

* Fixed tests
2016-11-11 14:53:26 -06:00
Sean Johnson
58430e4537 Domains API, #187 (#198) 2016-10-27 08:34:27 +02:00
Tobias Nyholm
738e6e32e2 POC - Better api (#192)
* Added base for the new API

* code style

* Added response classes

* Added support for serializer

* The abstract API should not know of Mailgun

* Minor

* minor

* Using a client configrator

* code style

* Put HTTPClient in the configurator

* Do not use the api() function

* Use stable version of Assert

* style

* Fixed tests

* make the httpClient private

* Renamed ResponseSerializer to ResponseDeserializer

* Disabled tests that are testing error messages with Assert

* style fixes

* Refactoring fix
2016-10-24 12:01:32 -05:00
Tobias Nyholm
043658f996 Added meta files (#195)
* Added meta files

* Style fixes from StyleCI
2016-10-14 19:20:46 -05:00
David Garcia
3aeb602406 Make sure $variables is an array in addRecipient() (#176)
* Write test to verify expected behaviour when we provide a String

* Fix broken test checking if the variable is an Array

* PSR Standard using single quote instead of double quote
2016-09-30 15:03:35 +02:00
David Garcia
6513c12d8c Applied fixes from StyleCI (#177) 2016-09-27 15:23:08 +02:00
Tobias Nyholm
8fe342f5b9 Apply fixes from StyleCI and make sure we add MIT license properly (#163)
* Applied fixes from StyleCI

* Create LICENSE
2016-09-18 09:56:14 +02:00
Wim Verstuyf
5d04bc63a7 Add attachment from memory (#158) 2016-09-06 13:05:50 +02:00
Tobias Nyholm
bf8d962739 Added more test cases 2016-08-10 18:28:19 +02:00
Tobias Nyholm
7119f18c26 Do not test same thing twice 2016-08-10 17:32:10 +02:00
Tobias Nyholm
741aa0d120 Make sure we use proper POST data arrays 2016-08-10 17:26:24 +02:00
Tobias Nyholm
9f98baa8ca Added more generic tests 2016-08-10 17:13:24 +02:00
Tobias Nyholm
cd001cf5b3 Added tests and use PSR4 2016-08-10 17:06:27 +02:00
Travis Swientek
0a7c96c34a Fixed inline image issue. Added new tests. 2016-08-10 16:37:08 +02:00
Tobias Nyholm
2515832216 Added functional tests 2016-08-05 10:40:49 +02:00
David Garcia
844cdb6a58 PHP Code Sniffer 2016-07-26 13:43:36 +01:00
David Garcia
817dad1f90 Applied fixes from StyleCI 2016-07-24 07:42:47 -04:00
Sergey Obukhov
b8a0abc075 Merge pull request #138 from Nyholm/issue-122
Build a string query form array
2016-07-20 14:56:59 -07:00
Sergey Obukhov
341e06a196 Merge pull request #90 from z38/fix-webhook-notices
Fix notices on empty webhook requests
2016-07-20 12:34:11 -07:00
Tobias Nyholm
aaf61b4466 test fix 2016-07-19 15:06:49 +02:00
Tobias Nyholm
b85f1461d4 Removed unused tests and some parameters from the constructor 2016-03-05 11:13:28 +01:00
Tobias Nyholm
b080b181ac Make sure we do not depend on any http transport library 2015-10-03 22:10:48 +02:00
z38
1f555c2f27 Fixed notices on empty webhook requests 2015-09-13 20:01:16 +02:00
Tobias Nyholm
3bb69d8cbe * Updated composer.json to guzzle v5
* Don't allow HHVM to fail
* Updated RestClient to Guzzle5
* Removed php5.3 from travis.
* Bugfix and removed debug code
2015-05-05 18:19:10 -07:00
Wietse de Vries
edae22eba4 Updated default API version from v2 to v3
http://blog.mailgun.com/default-api-version-now-v3/
2015-05-05 18:18:08 -07:00
Travis Swientek
b34805d86b Fixed broken test. 2014-11-19 14:52:34 -08:00
Travis Swientek
b28a742efb Merge branch 'verifyWebhookSignature' of https://github.com/gmacon/mailgun-php into gmacon-verifyWebhookSignature
Conflicts:
	src/Mailgun/Mailgun.php
2014-11-19 14:29:08 -08:00
Travis Swientek
f781158019 Removed legacy PHP closing braces 2014-10-06 15:53:33 -07:00
George Macon
46f63044ad Add Mailgun->verifyWebhookSignature 2014-06-24 17:36:21 -04:00
Iain Cambridge
e75c245cd6 Fix 5.3 compat 2014-05-14 14:08:12 +01:00
Iain Cambridge
e9e0f39ca8 Apply coding style that is in src 2014-05-14 14:06:05 +01:00
Iain Cambridge
6196f8df49 Add setMessage 2014-05-14 14:03:12 +01:00
Iain Cambridge
d28c6b81c9 Comment out possible php bug failure 2014-05-13 17:05:32 +01:00
Iain Cambridge
c203558234 Fix php 5.3 compat 2014-05-13 16:32:14 +01:00
Iain Cambridge
bdeadc1a01 Add tests to ensure exceptions are flung and fixed wrong variable name used 2014-05-13 16:12:32 +01:00
Iain Cambridge
502fac0b37 Fix fatal error in not finding exception.
Tried to throw MissingRequiredMIMEParameters which didn't exist in current namespace or added via use. Connection exceptions was included by MissingRequiredMIMEParameters is in messages exceptions so changed the added exception name to messages.

Exception message constant didn't exist. So added it.
2014-05-13 14:54:10 +01:00
Iain Cambridge
3af838f2c8 Move mocks
Created a Mocks directory to seperate mocks from classes.

I moved Mailgun\Tests\MailGunTest to Mailgun\Test\Mocks\Mailgun. As it's not a
test it's a mock. So shouldn't be suffixed with Test.

I mocked Mailgun\Tests\Connection\TestBroker to Mailgun\Tests\Mocks\Connection\TestBroker as it's a mock and should be with other mocks.
2014-05-13 14:25:26 +01:00
Travis Swientek
717cf5faed Improved security of OptInHandler. 2014-01-24 22:07:53 +00:00
Travis Swientek
af53fd50ff Ability to rename attachments and inline images. 2014-01-13 22:53:34 +00:00
Travis Swientek
5d7daeeeca Added method to return all message ids after a BatchMessage operation. 2013-10-11 17:31:04 -07:00
Travis Swientek
af853234e4 Refactored counters, batch job trigger adjustment, all recipient types in variables. 2013-10-11 13:36:35 -07:00
Travis Swientek
fc9685182b Fixed missing IDs for batch message recipients. Closes #15. 2013-10-07 13:53:23 -07:00