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

Commit

Permalink
Adds processor test
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Paul committed Oct 19, 2016
1 parent dc72200 commit 36ce858
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions tests/ProcessorTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

use CraigPaul\Moneris\Moneris;
use CraigPaul\Moneris\Processor;
use CraigPaul\Moneris\Response;
use CraigPaul\Moneris\Transaction;

class ProcessorTest extends TestCase
{
/**
* The Moneris gateway.
*
* @var \CraigPaul\Moneris\Gateway
*/
protected $gateway;

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

/**
* Set up the test environment.
*
* @return void
*/
public function setUp()
{
parent::setUp();

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

/** @test */
public function it_responds_to_an_invalid_transaction_with_the_proper_code_and_status()
{
$transaction = new Transaction($this->gateway);

$response = Processor::process($transaction);

$this->assertFalse($response->successful);
$this->assertEquals(Response::INVALID_TRANSACTION_DATA, $response->status);
}
}

0 comments on commit 36ce858

Please sign in to comment.