Webtest fix - ensure user is admin before messing with payment processors
authorColeman Watts <coleman@civicrm.org>
Fri, 19 Sep 2014 03:10:11 +0000 (23:10 -0400)
committerColeman Watts <coleman@civicrm.org>
Fri, 19 Sep 2014 03:10:11 +0000 (23:10 -0400)
tests/phpunit/CiviTest/CiviSeleniumTestCase.php

index cb33571f294b7b466d457e98b2e6b027f4e938e2..7b54781ce811836b2554547ba314aab4eb394177 100644 (file)
@@ -725,6 +725,9 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
     if (!$processorName) {
       $this->fail("webTestAddPaymentProcessor requires $processorName.");
     }
+    // Ensure we are logged in as admin before we proceed
+    $this->webtestLogin('admin');
+
     if ($processorName === 'Test Processor') {
       // Use the default test processor, no need to create a new one
       $this->openCiviPage('admin/paymentProcessor', 'action=update&id=1&reset=1');
@@ -732,6 +735,15 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
       $this->clickLink('_qf_PaymentProcessor_next-bottom');
       return 1;
     }
+
+    if ($processorType == 'Dummy') {
+      $processorSettings = array(
+        'user_name' => 'dummy',
+        'url_site' => 'http://dummy.com',
+        'test_user_name' => 'dummytest',
+        'test_url_site' => 'http://dummytest.com',
+      );
+    }
     elseif ($processorType == 'AuthNet') {
       // FIXME: we 'll need to make a new separate account for testing
       $processorSettings = array(