public function testSirenReturnsAWellFormattedSiren() { $siren = $this->faker->siren(); $this->assertRegExp("/^\\d{3}\\s\\d{3}\\s\\d{3}\$/", $siren); $siren = str_replace(' ', '', $siren); $this->assertTrue(Luhn::isValid($siren)); }
public function testImeiReturnsValidNumber() { $imei = $this->faker->imei(); $this->assertTrue(Luhn::isValid($imei)); }
public function testPersonalIdentityNumberGeneratesLuhnCompliantNumbers() { $pin = str_replace('-', '', $this->faker->personalIdentityNumber()); $this->assertTrue(Luhn::isValid($pin)); }
/** * @dataProvider validatorProvider */ public function testIsValid($number, $isValid) { $this->assertEquals($isValid, Luhn::isValid($number)); }
/** * @dataProvider creditCardNumberProvider */ public function testCreditCardNumberReturnsValidCreditCardNumber($type, $regexp) { $cardNumber = $this->faker->creditCardNumber($type); $this->assertRegExp($regexp, $cardNumber); $this->assertTrue(Luhn::isValid($cardNumber)); }