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);
 }
 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);
 }
 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);
 }
 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);
 }
 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);
 }
 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);
 }
 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);
 }
 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);
     }
 }
 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);
     }
 }
 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);
     }
 }
 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);
 }
 public function testGetAccountReturnsCorrectData()
 {
     $this->setMockResponse($this->client, array('accounts/getAccount'));
     $account = $this->client->getAccount();
     $this->assertInstanceOf('\\Mgrt\\Model\\Account', $account);
 }