public function testWsdlHttpFileNotFound() { $this->setExpectedException('Zend\\Service\\LiveDocx\\Exception\\RuntimeException'); $mailMerge = new MailMerge(); $mailMerge->setUsername(TESTS_ZEND_SERVICE_LIVEDOCX_USERNAME)->setPassword(TESTS_ZEND_SERVICE_LIVEDOCX_PASSWORD)->setWsdl('http://www.livedocx.com/file-not-found.wsdl'); $mailMerge->listTemplates(); unset($mailMerge); }
<?php require_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Bootstrap.php'; use Zend\Service\LiveDocx\Helper; use Zend\Service\LiveDocx\MailMerge; Helper::printLine(PHP_EOL . 'Remotely Stored Templates' . PHP_EOL . PHP_EOL . 'The following templates are currently stored on the LiveDocx server:' . PHP_EOL . PHP_EOL); $mailMerge = new MailMerge(); $mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD); print Helper::listDecorator($mailMerge->listTemplates()); unset($mailMerge);
<?php require_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Bootstrap.php'; use Zend\Service\LiveDocx\Helper; use Zend\Service\LiveDocx\MailMerge; Helper::printLine(PHP_EOL . 'Downloading Remotely Stored Templates' . PHP_EOL . PHP_EOL); $mailMerge = new MailMerge(); $mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD); $counter = 1; foreach ($mailMerge->listTemplates() as $result) { printf('%d) %s', $counter, $result['filename']); $template = $mailMerge->downloadTemplate($result['filename']); file_put_contents('downloaded-' . $result['filename'], $template); print ' - DOWNLOADED.' . PHP_EOL; $counter++; } print PHP_EOL; unset($mailMerge);