Skip to content

Commit 56c1d49

Browse files
committed
Merge pull request #91 from timgws/master
Ensure that code has 100% test coverage
2 parents 4c27374 + 17a420a commit 56c1d49

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

tests/Omnipay/Common/CreditCardTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ public function testCustomBrandWorks()
127127
$this->assertEquals('omniexpress', $this->card->getBrand());
128128
}
129129

130+
public function testCustomBrandAddedTwiceReturnsFalse()
131+
{
132+
$this->assertTrue($this->card->addSupportedBrand('omniexpress', '/^9\d{12}(\d{3})?$/'));
133+
$this->assertArrayHasKey('omniexpress', $this->card->getSupportedBrands());
134+
$this->assertFalse($this->card->addSupportedBrand('omniexpress', '/^9\d{12}(\d{3})?$/'));
135+
}
136+
130137
public function testTitle()
131138
{
132139
$this->card->setTitle('Mr.');

tests/Omnipay/Common/Message/AbstractResponseTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ public function testGetRedirectResponseInvalidMethod()
9090

9191
$this->response->getRedirectResponse();
9292
}
93+
94+
public function testGetTransactionIdNull()
95+
{
96+
$this->response = m::mock('\Omnipay\Common\Message\AbstractResponseTest_MockRedirectResponse')->makePartial();
97+
$this->assertNull($this->response->getTransactionId());
98+
}
9399
}
94100

95101
class AbstractResponseTest_MockRedirectResponse extends AbstractResponse implements RedirectResponseInterface

0 commit comments

Comments
 (0)