Skip to content
This repository has been archived by the owner on Oct 30, 2020. It is now read-only.

Commit

Permalink
Moves id, token and environment to TestCase
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Paul committed Oct 19, 2016
1 parent ff055f3 commit a933892
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 44 deletions.
29 changes: 1 addition & 28 deletions tests/GatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,13 @@ class GatewayTest extends TestCase
*/
protected $gateway;

/**
* The environment used for connecting to the Moneris API.
*
* @var string
*/
protected $environment;

/**
* The Moneris store id.
*
* @var string
*/
protected $id;

/**
* The Moneris API parameters.
*
* @var array
*/
protected $params;

/**
* The Moneris API token.
*
* @var string
*/
protected $token;

/**
* Set up the test environment.
*
Expand All @@ -51,13 +30,7 @@ public function setUp()
{
parent::setUp();

$this->id = 'store1';
$this->token = 'yesguy';
$this->environment = Moneris::ENV_TESTING;
$this->params = [
'environment' => $this->environment
];

$this->params = ['environment' => $this->environment];
$this->gateway = Moneris::create($this->id, $this->token, $this->params)->connect();
}

Expand Down
16 changes: 0 additions & 16 deletions tests/MonerisTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,13 @@

class MonerisTest extends TestCase
{
/**
* The Moneris store id.
*
* @var string
*/
protected $id;

/**
* The Moneris API parameters.
*
* @var array
*/
protected $params;

/**
* The Moneris API token.
*
* @var string
*/
protected $token;

/**
* Set up the test environment.
*
Expand All @@ -35,8 +21,6 @@ public function setUp()
{
parent::setUp();

$this->id = 'store1';
$this->token = 'yesguy';
$this->params = [
'environment' => Moneris::ENV_TESTING
];
Expand Down
21 changes: 21 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
<?php

use CraigPaul\Moneris\Moneris;

class TestCase extends PHPUnit_Framework_TestCase
{
/**
* @var string
*/
protected $amex;

/**
* @var string
*/
protected $environment;

/**
* @var string
*/
protected $id;

/**
* @var string
*/
protected $mastercard;

/**
* @var string
*/
protected $token;

/**
* @var string
*/
Expand All @@ -29,5 +46,9 @@ public function setUp()
$this->amex = '373599005095005';
$this->mastercard = '5454545454545454';
$this->visa = '4242424242424242';

$this->id = 'store1';
$this->token = 'yesguy';
$this->environment = Moneris::ENV_TESTING;
}
}

0 comments on commit a933892

Please sign in to comment.