public function testCustomBrandWorks() { $this->card->addSupportedBrand('omniexpress', '/^9\\d{12}(\\d{3})?$/'); $this->assertArrayHasKey('omniexpress', $this->card->getSupportedBrands()); $this->card->setNumber('9111111111111110'); $this->card->validate(); $this->assertEquals('omniexpress', $this->card->getBrand()); }
public function testCustomBrandAddedTwiceReturnsFalse() { $this->assertTrue($this->card->addSupportedBrand('omniexpress', '/^9\\d{12}(\\d{3})?$/')); $this->assertArrayHasKey('omniexpress', $this->card->getSupportedBrands()); $this->assertFalse($this->card->addSupportedBrand('omniexpress', '/^9\\d{12}(\\d{3})?$/')); }