You are here

function PhonePanamanianTest::testValidatingPanamenianPhoneNumber in Phone 7

Same name and namespace in other branches
  1. 6 tests/phone-pa.test \PhonePanamanianTest::testValidatingPanamenianPhoneNumber()

File

tests/phone.pa.test, line 13

Class

PhonePanamanianTest

Code

function testValidatingPanamenianPhoneNumber() {
  $this
    ->assertTrue(valid_phone_number('pa', '+507 260-4334'), '+507 260-4334 should be valid');
  $this
    ->assertTrue(valid_phone_number('pa', '+507 2604334'), '+507 2604334 should be valid');
  $this
    ->assertTrue(valid_phone_number('pa', '+507 260 4334'), '+507 260 4334 should be valid');
  $this
    ->assertTrue(valid_phone_number('pa', '00507 2603133'), '00507 2603133 should be valid');
  $this
    ->assertTrue(valid_phone_number('pa', '00507 260-3133'), '00507 260-3133 should be valid');
  $this
    ->assertTrue(valid_phone_number('pa', '00507 260 4334'), '00507 260 4334 should be valid');
  $this
    ->assertTrue(valid_phone_number('pa', '260 3133'), '260 3133 should be valid');
  $this
    ->assertTrue(valid_phone_number('pa', '260-3133'), '260-3133 should be valid');
  $this
    ->assertTrue(valid_phone_number('pa', '2603133'), '2603133 should be valid');

  //Cellphones
  $this
    ->assertTrue(valid_phone_number('pa', '+507 6545-4345'), '+507 6545-4345 should be valid');
  $this
    ->assertTrue(valid_phone_number('pa', '+507 65454345'), '+507 65454345 should be valid');
  $this
    ->assertTrue(valid_phone_number('pa', '+507 6545 4345'), '+507 6545 4345 should be valid');
  $this
    ->assertTrue(valid_phone_number('pa', '00507 6545-4345'), '00507 6545-4345 should be valid');
  $this
    ->assertTrue(valid_phone_number('pa', '00507 6545 4345'), '00507 6545 4345 should be valid');
  $this
    ->assertTrue(valid_phone_number('pa', '00507 65454345'), '00507 65454345 should be valid');
  $this
    ->assertTrue(valid_phone_number('pa', '6545-4345'), '6545-4345 should be valid');
  $this
    ->assertTrue(valid_phone_number('pa', '6545 4345'), '6545 4345 should be valid');
  $this
    ->assertTrue(valid_phone_number('pa', '65454345'), '65454345 should be valid');

  //Invalid
  $this
    ->assertFalse(valid_phone_number('pa', '35343'), '35343 should not be valid');
  $this
    ->assertFalse(valid_phone_number('pa', '320-43'), '320-43 should not be valid');
  $this
    ->assertTrue(valid_phone_number('pa', '(507) 435-3434'), '(507) 435-3434 should not be valid');
}