Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add fixtures.ini instead of login.php for unit tests

  • Loading branch information...
commit bf597452aec361f731988798054770238e4e09fc 1 parent 881c3df
@akDeveloper authored
View
8 unit_tests/AktiveMerchant/Billing/Gateways/AuthorizeNetTest.php
@@ -9,7 +9,7 @@
require_once 'config.php';
/**
- * AuthorizeNetTest class.
+ * Unit tests for AuthorizeNet gateway.
*
*
* @package Aktive-Merchant
@@ -33,10 +33,8 @@ public function setUp()
{
Base::mode('test');
- $login_info = array(
- 'login' => 'x',
- 'password' => 'y'
- );
+ $login_info = $this->getFixtures()->offsetGet('authorize_net');
+
$this->gateway = new AuthorizeNet($login_info);
$this->amount = 100;
View
6 unit_tests/AktiveMerchant/Billing/Gateways/CardstreamTest.php
@@ -28,10 +28,8 @@ class CardstreamTest extends AktiveMerchant\TestCase
public function setUp()
{
Base::mode('test');
-
- $login_info = array(
- 'login' => 'x',
- 'password' => 'y');
+
+ $login_info = $this->getFixtures()->offsetGet('cardstream');
$this->gateway = new Cardstream($login_info);
View
5 unit_tests/AktiveMerchant/Billing/Gateways/EwayTest.php
@@ -26,9 +26,8 @@ public function setUp()
{
Base::mode('test');
- $login_info = array(
- 'login' => 'x',
- );
+ $login_info = $this->getFixtures()->offsetGet('eway');
+
$this->gateway = new Eway($login_info);
$this->amount = 100;
View
10 unit_tests/AktiveMerchant/Billing/Gateways/HsbcSecureEpaymentsTest.php
@@ -33,12 +33,10 @@ function setUp()
{
Base::mode('test');
- $options = array(
- 'login' => 'x',
- 'password' => 'y',
- 'client_id' => 'z',
- 'currency' => 'EUR'
- );
+ $options = $this->getFixtures()->offsetGet('hsbc');
+
+ $options['currency'] = 'EUR';
+
$this->gateway = new HsbcSecureEpayments($options);
$this->amount = 100;
View
12 unit_tests/AktiveMerchant/Billing/Gateways/PaypalExpressTest.php
@@ -26,13 +26,11 @@ public function setUp()
{
Base::mode('test');
- $this->gateway = new PaypalExpress(array(
- 'login' => 'x',
- 'password' => 'y',
- 'signature' => 'z',
- 'currency' => 'EUR'
- )
- );
+ $options = $this->getFixtures()->offsetGet('paypal_express');
+
+ $options['currency'] = 'EUR';
+
+ $this->gateway = new PaypalExpress($options);
$this->amount = 100;
$this->options = array(
View
12 unit_tests/AktiveMerchant/Billing/Gateways/PaypalTest.php
@@ -29,13 +29,11 @@ public function setUp()
{
Base::mode('test');
- $this->gateway = new Paypal(array(
- 'login' => 'x',
- 'password' => 'y',
- 'signature' => 'z',
- 'currency' => 'USD'
- )
- );
+ $options = $this->getFixtures()->offsetGet('paypal_pro');
+
+ $options['currency'] = 'USD';
+
+ $this->gateway = new Paypal($options);
$this->amount = 100;
$this->creditcard = new CreditCard(array(
"first_name" => "John",
View
11 unit_tests/AktiveMerchant/Billing/Gateways/PiraeusPaycenterTest.php
@@ -31,14 +31,9 @@ function setUp()
{
Base::mode('test');
- $options = array(
- 'acquire_id' => 'x',
- 'merchant_id' => 'y',
- 'pos_id' => 'z',
- 'user' => 'b',
- 'password' => 'a',
- 'channel_type' => 'c'
- );
+
+ $options = $this->getFixtures()->offsetGet('piraeus_paycenter');
+
$this->gateway = new PiraeusPaycenter($options);
$this->amount = 100;
View
5 unit_tests/AktiveMerchant/Billing/Gateways/PsigateTest.php
@@ -59,9 +59,8 @@ function __construct() {
*/
function setUp()
{
- $this->login_info = array(
- 'login' => PSIGATE_LOGIN,
- 'password' => PSIGATE_PASS);
+ $this->login_info = $this->getFixtures()->offsetGet('psigate');
+
$this->gateway = new TestPsigate($this->login_info);
Base::mode('test');
View
6 unit_tests/AktiveMerchant/Billing/Gateways/RealexTest.php
@@ -27,10 +27,8 @@ public function setUp()
{
Base::mode('test');
- $login_info = array(
- 'login' => 'x',
- 'password' => 'y');
-
+ $login_info = $this->getFixtures()->offsetGet('realex');
+
$this->gateway = new Realex($login_info);
$this->amount = 100;
View
7 unit_tests/AktiveMerchant/TestCase.php
@@ -6,6 +6,13 @@
class TestCase extends \PHPUnit_Framework_TestCase
{
+
+ public function getFixtures()
+ {
+ $ini = parse_ini_file("fixtures.ini", true);
+ return new \ArrayIterator($ini);
+ }
+
protected function assert_success($response)
{
$this->assertTrue($response->success());
View
1  unit_tests/config.php
@@ -1,6 +1,5 @@
<?php
require_once __DIR__ . '/../autoload.php';
-require_once __DIR__ . '/../test/login.php';
require_once __DIR__ . '/AktiveMerchant/Mock/Request.php';
require_once __DIR__ . '/AktiveMerchant/TestCase.php';
?>
View
40 unit_tests/fixtures.ini
@@ -0,0 +1,40 @@
+[authorize_net]
+login = 'x'
+password = 'y'
+[cardstream]
+login = 'x'
+password = 'y'
+[epdq]
+login = 'x'
+password = 'y'
+client_id = 'z'
+[eway]
+login = '87654321'
+[hsbc]
+login = 'x'
+password = 'y'
+client_id = 'z'
+[payflowuk]
+login = 'x'
+password = 'y'
+[paypal_express]
+login = 'x'
+password = 'y'
+signature = 'z'
+[paypal_pro]
+login = 'x'
+password = 'y'
+signature = 'z'
+[piraeus_paycenter]
+acquire_id = 'x',
+merchant_id = 'y',
+pos_id = 'z',
+user = 'b',
+password = 'a',
+channel_type = 'c'
+[psigate]
+login = 'teststore'
+password = 'psigate1234'
+[realex]
+login = 'x'
+password = 'y'
Please sign in to comment.
Something went wrong with that request. Please try again.