assertInternalType('string', $checkDigit); $this->assertEquals($checkDigit, Luhn::computeCheckDigit($partialNumber)); } public function validatorProvider() { return array( array('79927398710', false), array('79927398711', false), array('79927398712', false), array('79927398713', true), array('79927398714', false), array('79927398715', false), array('79927398716', false), array('79927398717', false), array('79927398718', false), array('79927398719', false), array(79927398713, true), array(79927398714, false), ); } /** * @dataProvider validatorProvider */ public function testIsValid($number, $isValid) { $this->assertEquals($isValid, Luhn::isValid($number)); } /** * @expectedException InvalidArgumentException * @expectedExceptionMessage Argument should be an integer. */ public function testGenerateLuhnNumberWithInvalidPrefix() { Luhn::generateLuhnNumber('abc'); } }