From e8eccbf514bb683e715f625200ef826256e5d655 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 18 Sep 2014 23:10:11 -0400 Subject: [PATCH] Webtest fix - ensure user is admin before messing with payment processors --- tests/phpunit/CiviTest/CiviSeleniumTestCase.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php index cb33571f29..7b54781ce8 100644 --- a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php +++ b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php @@ -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( -- 2.25.1