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

Commit

Permalink
Changes order id to be unique-ish. Adds toXml test
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Paul committed Oct 19, 2016
1 parent a14c21f commit 2d60a32
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/TransactionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class TransactionTest extends TestCase
protected $params;

/**
* The Transaction instance.
*
* @var \CraigPaul\Moneris\Transaction
*/
protected $transaction;
Expand All @@ -37,7 +39,7 @@ public function setUp()
$this->gateway = Moneris::create($this->id, $this->token, $this->params)->connect();
$this->params = [
'type' => 'purchase',
'order_id' => '1234-567890',
'order_id' => uniqid('1234-56789', true),
'amount' => '1.00',
'pan' => $this->visa,
'expdate' => '2012',
Expand Down Expand Up @@ -84,4 +86,13 @@ public function it_can_determine_that_an_improper_set_of_parameters_has_been_pro
$this->assertFalse($transaction->valid());
$this->assertTrue($transaction->invalid());
}

/** @test */
public function it_can_transform_itself_to_an_xml_structure()
{
$xml = $this->transaction->toXml();
$xml = simplexml_load_string($xml);

$this->assertNotEquals(false, $xml);
}
}

0 comments on commit 2d60a32

Please sign in to comment.