Ejemplo n.º 1
0
 public function testUniqueArgsAccessors()
 {
     $email = new \SendGrid\Email();
     $unique_arguments = ['sub_1' => ['val_1.1', 'val_1.2', 'val_1.3'], 'sub_2' => ['val_2.1', 'val_2.2'], 'sub_3' => ['val_3.1', 'val_3.2', 'val_3.3', 'val_3.4'], 'sub_4' => ['val_4.1', 'val_4.2', 'val_4.3']];
     $email->setUniqueArgs($unique_arguments);
     $this->assertEquals('{"unique_args":{"sub_1":["val_1.1","val_1.2","val_1.3"],"sub_2":["val_2.1","val_2.2"],"sub_3":["val_3.1","val_3.2","val_3.3","val_3.4"],"sub_4":["val_4.1","val_4.2","val_4.3"]}}', $email->getSmtpapi()->jsonString());
     $email->addUniqueArg('uncle', 'bob');
     $this->assertEquals('{"unique_args":{"sub_1":["val_1.1","val_1.2","val_1.3"],"sub_2":["val_2.1","val_2.2"],"sub_3":["val_3.1","val_3.2","val_3.3","val_3.4"],"sub_4":["val_4.1","val_4.2","val_4.3"],"uncle":"bob"}}', $email->getSmtpapi()->jsonString());
 }
Ejemplo n.º 2
0
 public function testUniqueArgsAccessors()
 {
     $email = new SendGrid\Email();
     $unique_arguments = array("sub_1" => array("val_1.1", "val_1.2", "val_1.3"), "sub_2" => array("val_2.1", "val_2.2"), "sub_3" => array("val_3.1", "val_3.2", "val_3.3", "val_3.4"), "sub_4" => array("val_4.1", "val_4.2", "val_4.3"));
     $email->setUniqueArgs($unique_arguments);
     $this->assertEquals("{\"unique_args\":{\"sub_1\":[\"val_1.1\",\"val_1.2\",\"val_1.3\"],\"sub_2\":[\"val_2.1\",\"val_2.2\"],\"sub_3\":[\"val_3.1\",\"val_3.2\",\"val_3.3\",\"val_3.4\"],\"sub_4\":[\"val_4.1\",\"val_4.2\",\"val_4.3\"]}}", $email->smtpapi->jsonString());
     $email->addUniqueArg('uncle', 'bob');
     $this->assertEquals("{\"unique_args\":{\"sub_1\":[\"val_1.1\",\"val_1.2\",\"val_1.3\"],\"sub_2\":[\"val_2.1\",\"val_2.2\"],\"sub_3\":[\"val_3.1\",\"val_3.2\",\"val_3.3\",\"val_3.4\"],\"sub_4\":[\"val_4.1\",\"val_4.2\",\"val_4.3\"],\"uncle\":\"bob\"}}", $email->smtpapi->jsonString());
 }