From cc6a05436411a03abdd68f4efcf9d5eb999bba0e Mon Sep 17 00:00:00 2001 From: Craig Paul Date: Fri, 21 Oct 2016 11:11:35 -0600 Subject: [PATCH] Adds customer attaching test --- tests/CreditCardTest.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/CreditCardTest.php b/tests/CreditCardTest.php index 5980f54..448a181 100644 --- a/tests/CreditCardTest.php +++ b/tests/CreditCardTest.php @@ -1,10 +1,28 @@ card = CreditCard::create($this->visa, '2012'); + } + /** @test */ public function it_can_instantiate_via_the_constructor() { @@ -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); + } } \ No newline at end of file