Skip to content

Commit

Permalink
AuthTransactionTest::testAuthTransaction randomly fails (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
mglaman committed Aug 12, 2017
1 parent f437ccf commit 61abbb5
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions tests/CreateTransactionRequest/AuthTransactionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ public function testAuthTransaction()
->setTransactionRequest($transactionRequest);
$response = $request->execute();
$this->assertTrue(isset($response->transactionResponse));
$this->assertEquals('I00001', $response->getMessages()[0]->getCode());
$this->assertEquals('Successful.', $response->getMessages()[0]->getText());
$this->assertEquals('Ok', $response->getResultCode());
$this->assertResponse($response, 'I00001', 'Successful.', 'Ok');

sleep(1);

// Use a new number, otherwise a duplicate transaction is flagged.
$transactionRequest = $this->createChargableTransactionRequest(
TransactionRequest::AUTH_CAPTURE,
TransactionRequest::AUTH_ONLY,
'4007000000027'
);

Expand All @@ -33,8 +32,6 @@ public function testAuthTransaction()
->setTransactionRequest($transactionRequest);
$response = $request->execute();
$this->assertTrue(isset($response->transactionResponse));
$this->assertEquals('I00001', $response->getMessages()[0]->getCode());
$this->assertEquals('Successful.', $response->getMessages()[0]->getText());
$this->assertEquals('Ok', $response->getResultCode());
$this->assertResponse($response, 'I00001', 'Successful.', 'Ok');
}
}

0 comments on commit 61abbb5

Please sign in to comment.