You are here

public function NZPhoneNumberTestCase::testPhoneNZInvalid in Phone 7

Same name and namespace in other branches
  1. 6 tests/phone-nz.test \NZPhoneNumberTestCase::testPhoneNZInvalid()

File

tests/phone.nz.test, line 42

Class

NZPhoneNumberTestCase

Code

public function testPhoneNZInvalid() {
  $this
    ->assertFalse(valid_phone_number('nz', '021 3012 3456'), t('Test invalid 10-digit Vodafone number in wrong range 021 3012 3456'));
  $this
    ->assertFalse(valid_phone_number('nz', '04 701 1234'), t('Test invalid Wellington regional number 04 701 1234'));
  $this
    ->assertFalse(valid_phone_number('nz', '(06) 412 3456'), t('Test invalid Manawatu regional number (06) 412 3456'));
  $this
    ->assertFalse(valid_phone_number('nz', '04 123 456'), t('Test too short Wellington regional number 04 123 456'));
  $this
    ->assertFalse(valid_phone_number('nz', '[04] 123 4567'), t('Test invalid character Wellington regional [04] 123 4567'));
  $this
    ->assertFalse(valid_phone_number('nz', '09 701 2345'), t('Test invalid Auckland regional 09 701 2345'));
  $this
    ->assertFalse(valid_phone_number('nz', '028 123 4567'), t('Test invalid mobile range 028 123 4567'));
  $this
    ->assertFalse(valid_phone_number('nz', '027 1234 5678'), t('Test invalid Telecom mobile length 027 1234 5678'));
}