From 4178cb8dcd430131ef15acede771ae788ce29851 Mon Sep 17 00:00:00 2001 From: Craig Paul Date: Fri, 21 Oct 2016 15:23:59 -0600 Subject: [PATCH] Adds get expiring test --- tests/VaultTest.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/VaultTest.php b/tests/VaultTest.php index 50147b4..932e74a 100644 --- a/tests/VaultTest.php +++ b/tests/VaultTest.php @@ -149,4 +149,23 @@ public function it_can_peek_into_the_vault_and_retrieve_a_full_credit_card_from_ $this->assertEquals('2012', $receipt->ResolveData->expdate); $this->assertEquals($this->visa, $receipt->ResolveData->pan); } + + /** @test */ + public function it_can_retrieve_all_expiring_credit_cards_from_the_moneris_vault() + { + $expiry = date('ym', strtotime('today + 10 days')); + + $card = CreditCard::create($this->visa, $expiry); + $this->vault->add($card); + $card = CreditCard::create($this->mastercard, $expiry); + $this->vault->add($card); + $card = CreditCard::create($this->amex, $expiry); + $this->vault->add($card); + + $response = $this->vault->expiring(); + $receipt = $response->receipt(); + + $this->assertTrue($response->successful); + $this->assertGreaterThan(0, count($receipt->ResolveData)); + } } \ No newline at end of file