mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-29 00:25:37 +03:00
Fix bug toRecipientCount increment in BatchMessage
This commit is contained in:
parent
a1418420d0
commit
789eb27228
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,3 +6,4 @@ rackspace_logo.jpg
|
|||||||
mailgun_icon.png
|
mailgun_icon.png
|
||||||
build
|
build
|
||||||
composer.lock
|
composer.lock
|
||||||
|
nbproject/*
|
||||||
|
@ -38,7 +38,6 @@ class BatchMessage extends MessageBuilder{
|
|||||||
$this->addRecipient("to", $address, $variables);
|
$this->addRecipient("to", $address, $variables);
|
||||||
$attributes["id"] = $this->toRecipientCount;
|
$attributes["id"] = $this->toRecipientCount;
|
||||||
$this->batchRecipientAttributes["$address"] = $variables;
|
$this->batchRecipientAttributes["$address"] = $variables;
|
||||||
$this->toRecipientCount++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sendMessage($message = array(), $files = array()){
|
public function sendMessage($message = array(), $files = array()){
|
||||||
|
@ -50,6 +50,15 @@ class BatchMessageTest extends \Mailgun\Tests\MailgunTestCase{
|
|||||||
$messageObj= $message->getMessage();
|
$messageObj= $message->getMessage();
|
||||||
$this->assertTrue(true, empty($messageObj));
|
$this->assertTrue(true, empty($messageObj));
|
||||||
}
|
}
|
||||||
|
public function testToRecipientCount() {
|
||||||
|
$message = $this->client->BatchMessage($this->sampleDomain);
|
||||||
|
$message->addToRecipient("test-user@samples.mailgun.org", array("first" => "Test", "last" => "User"));
|
||||||
|
|
||||||
|
$reflectionClass = new \ReflectionClass(get_class($message));
|
||||||
|
$property = $reflectionClass->getProperty('toRecipientCount');
|
||||||
|
$property->setAccessible(true);
|
||||||
|
$this->assertEquals(1, $property->getValue($message));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user