diff --git a/.gitignore b/.gitignore index cbc7bd2..dc48fa8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ mailgun_icon.png build composer.lock nbproject/* +.idea diff --git a/src/Mailgun/Constants/Constants.php b/src/Mailgun/Constants/Constants.php index 0f0a053..b5034a6 100644 --- a/src/Mailgun/Constants/Constants.php +++ b/src/Mailgun/Constants/Constants.php @@ -12,6 +12,7 @@ const DEFAULT_TIME_ZONE = "UTC"; const EXCEPTION_INVALID_CREDENTIALS = "Your credentials are incorrect."; const EXCEPTION_GENERIC_HTTP_ERROR = "An HTTP Error has occurred! Check your network connection and try again."; const EXCEPTION_MISSING_REQUIRED_PARAMETERS = "The parameters passed to the API were invalid. Check your inputs!"; +const EXCEPTION_MISSING_REQUIRED_MIME_PARAMETERS = "The parameters passed to the API were invalid. Check your inputs!"; const EXCEPTION_MISSING_ENDPOINT = "The endpoint you've tried to access does not exist. Check your URL."; const TOO_MANY_RECIPIENTS = "You've exceeded the maximum recipient count (1,000) on the to field with autosend disabled."; const INVALID_PARAMETER_NON_ARRAY = "The parameter you've passed in position 2 must be an array."; diff --git a/src/Mailgun/Mailgun.php b/src/Mailgun/Mailgun.php index 45bf736..9699a01 100644 --- a/src/Mailgun/Mailgun.php +++ b/src/Mailgun/Mailgun.php @@ -2,10 +2,10 @@ namespace Mailgun; -require 'Constants/Constants.php'; +require_once 'Constants/Constants.php'; use Mailgun\Messages\Messages; -use Mailgun\Connection\Exceptions; +use Mailgun\Messages\Exceptions; use Mailgun\Connection\RestClient; use Mailgun\Messages\BatchMessage; use Mailgun\Lists\OptInHandler; @@ -52,7 +52,7 @@ class Mailgun{ unlink($fileName); } else{ - throw new MissingRequiredMIMEParameters(EXCEPTION_MISSING_REQUIRED_MIME_PARAMETERS); + throw new Exceptions\MissingRequiredMIMEParameters(EXCEPTION_MISSING_REQUIRED_MIME_PARAMETERS); } } diff --git a/tests/Mailgun/Tests/MailgunTest.php b/tests/Mailgun/Tests/MailgunTest.php new file mode 100644 index 0000000..d8c704f --- /dev/null +++ b/tests/Mailgun/Tests/MailgunTest.php @@ -0,0 +1,17 @@ +setExpectedException("\\Mailgun\\Messages\\Exceptions\\MissingRequiredMIMEParameters"); + + $client = new Mailgun(); + $client->sendMessage("test.mailgun.com", "etss", 1); + } +} + +?> \ No newline at end of file