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

Commit

Permalink
Adds customer attaching test
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Paul committed Oct 21, 2016
1 parent 32cb5d0 commit cc6a054
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/CreditCardTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
<?php

use CraigPaul\Moneris\Crypt;
use CraigPaul\Moneris\Customer;
use CraigPaul\Moneris\CreditCard;

class CreditCardTest extends TestCase
{
/**
* @var \CraigPaul\Moneris\CreditCard
*/
protected $card;

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

$this->card = CreditCard::create($this->visa, '2012');
}

/** @test */
public function it_can_instantiate_via_the_constructor()
{
Expand All @@ -24,4 +42,14 @@ public function it_can_instantiate_via_a_static_create_method()
$this->assertObjectHasAttribute('number', $card);
$this->assertObjectHasAttribute('expiry', $card);
}

/** @test */
public function it_can_attach_a_customer_to_a_credit_card()
{
$customer = Customer::create();

$this->card->attach($customer);

$this->assertEquals($customer, $this->card->customer);
}
}

0 comments on commit cc6a054

Please sign in to comment.