public function testShouldValidateCardNumberForModel($type, $cardnumber, $willReturn)
{
$validation = new Validation();
if ($type) {
$validation->add('creditcard', new CardNumber(['type' => $type]));
} else {
$validation->add('creditcard', new CardNumber());
}
$messages = $validation->validate(['creditcard' => $cardnumber]);
$this->assertNotEquals($willReturn, $messages->valid());
}