Пример #1
0
 public function testConstructorOptionsUsernamePasswordSoapClient()
 {
     $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(array('username' => TESTS_ZEND_SERVICE_LIVEDOCX_USERNAME, 'password' => TESTS_ZEND_SERVICE_LIVEDOCX_PASSWORD, 'soapClient' => new Zend_Soap_Client(self::ENDPOINT)));
     $this->assertTrue($phpLiveDocx->logIn());
 }
$counter++;
// -----------------------------------------------------------------------------
if (defined('DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME') && defined('DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD')) {
    $result = TEST_PASS;
} else {
    $result = TEST_FAIL;
    $failed = true;
}
printLine($counter, 'Checking backend credentials are defined', $result);
$counter++;
// -----------------------------------------------------------------------------
$errorMessage = null;
try {
    $microtime = microtime(true);
    $mailMerge = new Zend_Service_LiveDocx_MailMerge(array('username' => DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME, 'password' => DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD));
    $mailMerge->logIn();
    $duration = microtime(true) - $microtime;
} catch (Zend_Service_LiveDocx_Exception $e) {
    $duration = -1;
    $errorMessage = $e->getMessage();
}
if (is_null($errorMessage)) {
    $result = TEST_PASS;
} else {
    $result = TEST_FAIL;
    $failed = true;
}
printLine($counter, sprintf('Logging into backend service (%01.2fs)', $duration), $result);
$counter++;
// -----------------------------------------------------------------------------
if (true === $failed) {
Пример #3
0
$counter++;
// -----------------------------------------------------------------------------
if (defined('DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME') && defined('DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD')) {
    $result = TEST_PASS;
} else {
    $result = TEST_FAIL;
    $failed = true;
}
printLine($counter, 'Checking backend credentials are defined', $result);
$counter++;
// -----------------------------------------------------------------------------
$errorMessage = null;
try {
    $microtime = microtime(true);
    $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(array('username' => DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME, 'password' => DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD));
    $phpLiveDocx->logIn();
    $duration = microtime(true) - $microtime;
} catch (Zend_Service_LiveDocx_Exception $e) {
    $duration = -1;
    $errorMessage = $e->getMessage();
}
if (is_null($errorMessage)) {
    $result = TEST_PASS;
} else {
    $result = TEST_FAIL;
    $failed = true;
}
printLine($counter, sprintf('Logging into backend service (%01.2fs)', $duration), $result);
$counter++;
// -----------------------------------------------------------------------------
if (true === $failed) {