コード例 #1
0
 public function testGetSystemDateReturnsCorrectData()
 {
     $this->setMockResponse($this->client, array('core/getSystemDate'));
     $datetime = $this->client->getSystemDate();
     // Raise exception if date format is incorrect
     $datetime = new \DateTime($datetime);
 }
コード例 #2
0
 public function testCheckDomainReturnsCorrectData()
 {
     $domain = new Domain();
     $domain->setId(1);
     $this->setMockResponse($this->client, array('domains/checkDomain'));
     $domain = $this->client->checkDomain($domain);
     $this->assertInstanceOf('\\Mgrt\\Model\\Domain', $domain);
 }
コード例 #3
0
 public function testDeleteContactReturnsCorrectData()
 {
     $contact = new Contact();
     $contact->setId(1);
     $this->setMockResponse($this->client, array('contacts/deleteContact'));
     $result = $this->client->deleteContact($contact);
     $this->assertInternalType('boolean', $result);
     $this->assertEquals(true, $result);
 }
コード例 #4
0
 public function testDeleteApiKeyReturnsCorrectData()
 {
     $apiKey = new ApiKey();
     $apiKey->setId(1);
     $this->setMockResponse($this->client, array('api-keys/deleteApiKey'));
     $result = $this->client->deleteApiKey($apiKey);
     $this->assertInternalType('boolean', $result);
     $this->assertEquals(true, $result);
 }
コード例 #5
0
 public function testDeleteTemplateReturnsCorrectData()
 {
     $template = new Template();
     $template->setId(1);
     $this->setMockResponse($this->client, array('templates/deleteTemplate'));
     $result = $this->client->deleteTemplate($template);
     $this->assertInternalType('boolean', $result);
     $this->assertEquals(true, $result);
 }
コード例 #6
0
 public function testDeleteSenderReturnsCorrectData()
 {
     $sender = new Sender();
     $sender->setId(1);
     $this->setMockResponse($this->client, array('senders/deleteSender'));
     $result = $this->client->deleteSender($sender);
     $this->assertInternalType('boolean', $result);
     $this->assertEquals(true, $result);
 }
コード例 #7
0
 public function testUnscheduleCampaignReturnsCorrectData()
 {
     $campaign = $this->getFakeCampaign();
     $campaign->setId(1);
     $this->setMockResponse($this->client, array('campaigns/unscheduleCampaign'));
     $result = $this->client->unscheduleCampaign($campaign);
     $this->assertInternalType('boolean', $result);
     $this->assertEquals(true, $result);
 }
コード例 #8
0
 public function testGetInvoiceReturnsCorrectData()
 {
     $this->setMockResponse($this->client, array('invoices/getInvoice'));
     $invoice = $this->client->getInvoice(1);
     $this->assertInstanceOf('\\Mgrt\\Model\\Invoice', $invoice);
     $invoiceLines = $invoice->getInvoiceLines();
     foreach ($invoiceLines as $invoiceLine) {
         $this->assertInstanceOf('\\Mgrt\\Model\\InvoiceLine', $invoiceLine);
     }
 }
コード例 #9
0
 public function testGetCustomFieldsReturnsCorrectData()
 {
     $this->setMockResponse($this->client, array('custom-fields/getCustomFields'));
     $customFields = $this->client->getCustomFields();
     $this->assertInstanceOf('\\Mgrt\\Model\\ResultCollection', $customFields);
     $this->assertEquals($customFields->count(), 7);
     foreach ($customFields as $customField) {
         $this->assertInstanceOf('\\Mgrt\\Model\\CustomField', $customField);
     }
 }
コード例 #10
0
 public function testGetMailingListContactsReturnsCorrectData()
 {
     $mailingList = new MailingList();
     $mailingList->setId(1);
     $this->setMockResponse($this->client, array('mailing-lists/listMailingListContacts'));
     $contacts = $this->client->getMailingListContacts($mailingList);
     $this->assertInstanceOf('\\Mgrt\\Model\\ResultCollection', $contacts);
     $this->assertEquals($contacts->count(), 2);
     foreach ($contacts as $contact) {
         $this->assertInstanceOf('\\Mgrt\\Model\\Contact', $contact);
     }
 }
コード例 #11
0
 public function testGetWebhookCallReturnsCorrectData()
 {
     $webhook = new Webhook();
     $webhook->setId('00000000-0000-0000-0000-000000000000');
     $this->setMockResponse($this->client, array('webhooks/getWebhookCall'));
     $webhookCall = $this->client->getWebhookCall($webhook, '00000000-0000-0000-0000-000000000000');
     $this->assertInstanceOf('\\Mgrt\\Model\\WebhookCall', $webhookCall);
 }
コード例 #12
0
 public function testGetAccountReturnsCorrectData()
 {
     $this->setMockResponse($this->client, array('accounts/getAccount'));
     $account = $this->client->getAccount();
     $this->assertInstanceOf('\\Mgrt\\Model\\Account', $account);
 }