You are here

function PhonePanamanianTest::testValidatingPanamenianPhoneNumber in Phone 6

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

File

tests/phone-pa.test, line 19

Class

PhonePanamanianTest

Code

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

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

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