Skip to content

Commit

Permalink
fixed mock paths to work with one single mock dir
Browse files Browse the repository at this point in the history
  • Loading branch information
zmonteca committed Jul 12, 2017
1 parent 2118c56 commit a62904f
Show file tree
Hide file tree
Showing 20 changed files with 28 additions and 26 deletions.
16 changes: 8 additions & 8 deletions tests/CheckGatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function setUp()

public function testAuthorizeSuccess()
{
$this->setMockHttpResponse('../Messages/Check/Mock/ResponseSuccess.txt');
$this->setMockHttpResponse('Check/ResponseSuccess.txt');

$this->gateway->setPassword('demo123');
$response = $this->gateway->authorize($this->options)->send();
Expand All @@ -43,7 +43,7 @@ public function testAuthorizeSuccess()

public function testAuthorizeFailure()
{
$this->setMockHttpResponse('../Messages/Check/Mock/ResponseFailed.txt');
$this->setMockHttpResponse('Check/ResponseFailed.txt');

$this->gateway->setPassword('111');
$response = $this->gateway->authorize($this->options)->send();
Expand All @@ -55,7 +55,7 @@ public function testAuthorizeFailure()

public function testPurchaseSuccess()
{
$this->setMockHttpResponse('../Messages/Check/Mock/ResponseSuccess.txt');
$this->setMockHttpResponse('Check/ResponseSuccess.txt');

$this->gateway->setPassword('demo123');
$response = $this->gateway->purchase($this->options)->send();
Expand All @@ -72,7 +72,7 @@ public function testPurchaseSuccess()

public function testPurchaseFailure()
{
$this->setMockHttpResponse('../Messages/Check/Mock/ResponseFailed.txt');
$this->setMockHttpResponse('Check/ResponseFailed.txt');

$this->gateway->setPassword('111');
$response = $this->gateway->purchase($this->options)->send();
Expand All @@ -84,7 +84,7 @@ public function testPurchaseFailure()

public function testRefundSuccess()
{
$this->setMockHttpResponse('../Messages/Check/Mock/RefundResponseSuccess.txt');
$this->setMockHttpResponse('Check/RefundResponseSuccess.txt');

$this->gateway->setPassword('demo123');
$response = $this->gateway->refund($this->options)->send();
Expand All @@ -101,7 +101,7 @@ public function testRefundSuccess()

public function testRefundTransactionReferenceSuccess()
{
$this->setMockHttpResponse('../Messages/Check/Mock/RefundResponseSuccess.txt');
$this->setMockHttpResponse('Check/RefundResponseSuccess.txt');

$this->gateway->setPassword('demo123');
$options = array_merge(array('transactionReference' => 89731989), $this->options);
Expand All @@ -120,7 +120,7 @@ public function testRefundTransactionReferenceSuccess()

public function testRefundFailure()
{
$this->setMockHttpResponse('../Messages/Check/Mock/ResponseFailed.txt');
$this->setMockHttpResponse('Check/ResponseFailed.txt');

$this->gateway->setPassword('111');
$response = $this->gateway->refund($this->options)->send();
Expand All @@ -132,7 +132,7 @@ public function testRefundFailure()

public function testCreateCardSuccess()
{
$this->setMockHttpResponse('../Messages/Check/Mock/CreateCardResponseSuccess.txt');
$this->setMockHttpResponse('Check/CreateCardResponseSuccess.txt');

$this->gateway->setPassword('demo123');
$response = $this->gateway->createCard($this->options)->send();
Expand Down
20 changes: 10 additions & 10 deletions tests/CreditCardGatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function setUp()

public function testAuthorizeSuccess()
{
$this->setMockHttpResponse('../Messages/CreditCard/Mock/AuthorizeResponseSuccess.txt');
$this->setMockHttpResponse('CreditCard/AuthorizeResponseSuccess.txt');

$this->gateway->setPassword('demo123');
$response = $this->gateway->authorize($this->options)->send();
Expand All @@ -39,7 +39,7 @@ public function testAuthorizeSuccess()

public function testAuthorizeFailure()
{
$this->setMockHttpResponse('ResponseFailed.txt');
$this->setMockHttpResponse('CreditCard/ResponseFailed.txt');

$this->gateway->setPassword('111');
$response = $this->gateway->authorize($this->options)->send();
Expand All @@ -51,7 +51,7 @@ public function testAuthorizeFailure()

public function testPurchaseSuccess()
{
$this->setMockHttpResponse('../Messages/CreditCard/Mock/AuthorizeResponseSuccess.txt');
$this->setMockHttpResponse('CreditCard/AuthorizeResponseSuccess.txt');

$this->gateway->setPassword('demo123');
$response = $this->gateway->purchase($this->options)->send();
Expand All @@ -68,7 +68,7 @@ public function testPurchaseSuccess()

public function testPurchaseCreditReferenceSuccess()
{
$this->setMockHttpResponse('../Messages/CreditCard/Mock/AuthorizeResponseSuccess.txt');
$this->setMockHttpResponse('CreditCard/AuthorizeResponseSuccess.txt');

$this->gateway->setPassword('demo123');
$options = array_merge(array('cardReference' => 1234567890), $this->options);
Expand All @@ -86,7 +86,7 @@ public function testPurchaseCreditReferenceSuccess()

public function testPurchaseFailure()
{
$this->setMockHttpResponse('ResponseFailed.txt');
$this->setMockHttpResponse('CreditCard/ResponseFailed.txt');

$this->gateway->setPassword('111');
$response = $this->gateway->purchase($this->options)->send();
Expand All @@ -98,7 +98,7 @@ public function testPurchaseFailure()

public function testRefundSuccess()
{
$this->setMockHttpResponse('../Messages/CreditCard/Mock/RefundResponseSuccess.txt');
$this->setMockHttpResponse('CreditCard/RefundResponseSuccess.txt');

$this->gateway->setPassword('demo123');
$response = $this->gateway->refund($this->options)->send();
Expand All @@ -115,7 +115,7 @@ public function testRefundSuccess()

public function testRefundTransactionReferenceSuccess()
{
$this->setMockHttpResponse('../Messages/CreditCard/Mock/RefundResponseSuccess.txt');
$this->setMockHttpResponse('CreditCard/RefundResponseSuccess.txt');

$this->gateway->setPassword('demo123');
$options = array_merge(array('transactionReference' => 89731989), $this->options);
Expand All @@ -134,7 +134,7 @@ public function testRefundTransactionReferenceSuccess()

public function testRefundFailure()
{
$this->setMockHttpResponse('../Messages/CreditCard/Mock/ResponseFailed.txt');
$this->setMockHttpResponse('CreditCard/ResponseFailed.txt');

$this->gateway->setPassword('111');
$response = $this->gateway->refund($this->options)->send();
Expand All @@ -146,7 +146,7 @@ public function testRefundFailure()

public function testCreateCardSuccess()
{
$this->setMockHttpResponse('../Messages/CreditCard/Mock/CreateCardResponseSuccess.txt');
$this->setMockHttpResponse('CreditCard/CreateCardResponseSuccess.txt');

$this->gateway->setPassword('demo123');
$response = $this->gateway->createCard($this->options)->send();
Expand All @@ -165,7 +165,7 @@ public function testCreateCardSuccess()
public function testUpdateCardSuccess()
{
$customer_id = 14496097;
$this->setMockHttpResponse('../Messages/CreditCard/Mock/UpdateCardResponseSuccess.txt');
$this->setMockHttpResponse('CreditCard/UpdateCardResponseSuccess.txt');

$this->gateway->setPassword('demo123');
$request = $this->gateway->updateCard($this->options);
Expand Down
1 change: 1 addition & 0 deletions tests/Messages/Check/Mock/empty
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
empty
4 changes: 2 additions & 2 deletions tests/Messages/Check/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ResponseTest extends TestCase
{
public function testSuccess()
{
$httpResponse = $this->getMockHttpResponse('ResponseSuccess.txt');
$httpResponse = $this->getMockHttpResponse('../../../Mock/Check/ResponseSuccess.txt');
$response = new Response($this->getMockRequest(), $httpResponse->getBody());
$this->assertTrue($response->isSuccessful());
$this->assertSame('121', $response->getCode());
Expand All @@ -20,7 +20,7 @@ public function testSuccess()

public function testFail()
{
$httpResponse = $this->getMockHttpResponse('ResponseFailed.txt');
$httpResponse = $this->getMockHttpResponse('../../../Mock/Check/ResponseFailed.txt');
$response = new Response($this->getMockRequest(), $httpResponse->getBody());
$this->assertFalse($response->isSuccessful());
$this->assertSame('998', $response->getCode());
Expand Down
4 changes: 2 additions & 2 deletions tests/Messages/CreditCard/AuthorizeResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class AuthorizeResponseTest extends TestCase
{
public function testSuccess()
{
$httpResponse = $this->getMockHttpResponse('AuthorizeResponseSuccess.txt');
$httpResponse = $this->getMockHttpResponse('../../../Mock/CreditCard/AuthorizeResponseSuccess.txt');
$response = new AuthorizeResponse($this->getMockRequest(), $httpResponse->getBody());
$this->assertTrue($response->isSuccessful());
$this->assertSame('104', $response->getCode());
Expand All @@ -20,7 +20,7 @@ public function testSuccess()

public function testFail()
{
$httpResponse = $this->getMockHttpResponse('AuthorizeResponseFailed.txt');
$httpResponse = $this->getMockHttpResponse('../../../Mock/CreditCard/AuthorizeResponseFailed.txt');
$response = new AuthorizeResponse($this->getMockRequest(), $httpResponse->getBody());
$this->assertFalse($response->isSuccessful());
$this->assertSame('105', $response->getCode());
Expand Down
4 changes: 2 additions & 2 deletions tests/Messages/CreditCard/CaptureResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class CaptureResponseTest extends TestCase
{
public function testSuccess()
{
$httpResponse = $this->getMockHttpResponse('CaptureResponseSuccess.txt');
$httpResponse = $this->getMockHttpResponse('../../../Mock/CreditCard/CaptureResponseSuccess.txt');
$response = new CaptureResponse($this->getMockRequest(), $httpResponse->getBody());
$this->assertTrue($response->isSuccessful());
$this->assertSame('114', $response->getCode());
Expand All @@ -20,7 +20,7 @@ public function testSuccess()

public function testFail()
{
$httpResponse = $this->getMockHttpResponse('ResponseFailed.txt');
$httpResponse = $this->getMockHttpResponse('../../../Mock/CreditCard/ResponseFailed.txt');
$response = new CaptureResponse($this->getMockRequest(), $httpResponse->getBody());
$this->assertFalse($response->isSuccessful());
$this->assertSame('998', $response->getCode());
Expand Down
4 changes: 2 additions & 2 deletions tests/Messages/CreditCard/CreateCardResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class CreateCardResponseTest extends TestCase
{
public function testSuccess()
{
$httpResponse = $this->getMockHttpResponse('CreateCardResponseSuccess.txt');
$httpResponse = $this->getMockHttpResponse('../../../Mock/CreditCard/CreateCardResponseSuccess.txt');
$response = new CreateCardResponse($this->getMockRequest(), $httpResponse->getBody());
$this->assertTrue($response->isSuccessful());
$this->assertSame('160', $response->getCode());
Expand All @@ -20,7 +20,7 @@ public function testSuccess()

public function testFail()
{
$httpResponse = $this->getMockHttpResponse('ResponseFailed.txt');
$httpResponse = $this->getMockHttpResponse('../../../Mock/CreditCard/ResponseFailed.txt');
$response = new CreateCardResponse($this->getMockRequest(), $httpResponse->getBody());
$this->assertFalse($response->isSuccessful());
$this->assertSame('998', $response->getCode());
Expand Down
1 change: 1 addition & 0 deletions tests/Messages/CreditCard/Mock/empty
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
empty
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a62904f

Please sign in to comment.