mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-22 04:26:02 +03:00
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.
This commit is contained in:
parent
3af838f2c8
commit
502fac0b37
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,3 +7,4 @@ mailgun_icon.png
|
||||
build
|
||||
composer.lock
|
||||
nbproject/*
|
||||
.idea
|
||||
|
@ -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.";
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
17
tests/Mailgun/Tests/MailgunTest.php
Normal file
17
tests/Mailgun/Tests/MailgunTest.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?PHP
|
||||
namespace Mailgun\Tests\Lists;
|
||||
|
||||
use Mailgun\Mailgun;
|
||||
|
||||
class MailgunTest extends \Mailgun\Tests\MailgunTestCase{
|
||||
|
||||
public function testSendMessageMissingRequiredMIMEParametersExceptionGetsFlung()
|
||||
{
|
||||
$this->setExpectedException("\\Mailgun\\Messages\\Exceptions\\MissingRequiredMIMEParameters");
|
||||
|
||||
$client = new Mailgun();
|
||||
$client->sendMessage("test.mailgun.com", "etss", 1);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user