diff --git a/tests/GatewayTest.php b/tests/GatewayTest.php index 3415c16..642bc7d 100644 --- a/tests/GatewayTest.php +++ b/tests/GatewayTest.php @@ -29,8 +29,14 @@ public function setUp() { parent::setUp(); - $this->params = ['environment' => $this->environment]; - $this->gateway = Moneris::create($this->id, $this->token, $this->params)->connect(); + $params = ['environment' => $this->environment]; + $this->gateway = Moneris::create($this->id, $this->token, $params)->connect(); + $this->params = [ + 'order_id' => uniqid('1234-56789', true), + 'amount' => '1.00', + 'credit_card' => $this->visa, + 'expdate' => '2012', + ]; } /** @test */ @@ -55,14 +61,16 @@ public function it_can_access_properties_of_the_class() /** @test */ public function it_can_make_a_purchase_and_receive_a_response() { - $params = [ - 'order_id' => uniqid('1234-56789', true), - 'amount' => '1.00', - 'credit_card' => $this->visa, - 'expdate' => '2012', - ]; + $response = $this->gateway->purchase($this->params); + + $this->assertEquals(Response::class, get_class($response)); + $this->assertTrue($response->successful); + } - $response = $this->gateway->purchase($params); + /** @test */ + public function it_can_pre_authorize_a_purchase_and_receive_a_response() + { + $response = $this->gateway->preauth($this->params); $this->assertEquals(Response::class, get_class($response)); $this->assertTrue($response->successful);