You are here

phone-cl.test in Phone 6

File

tests/phone-cl.test
View source
<?php

class CLPhoneNumberTestCase extends DrupalWebTestCase {

  /**
   * Implementation of getInfo()
   *
   */
  public static function getInfo() {
    return array(
      'name' => t('Chili Phone number test'),
      'description' => t('Tests various valid and invalid Chili phone numbers for validity'),
      'group' => t('Phone'),
    );
  }
  public function testPhoneCLValid() {
    $this
      ->assertTrue(valid_phone_number('cl', '(041)245-9848'), t('Test valid'));
    $this
      ->assertTrue(valid_phone_number('cl', '(063)421-232'), t('Test valid'));
  }
  public function testPhoneCLInvalid() {
    $this
      ->assertFalse(valid_phone_number('cl', '0412459848'), t('Test invalid '));
    $this
      ->assertFalse(valid_phone_number('cl', '063421232'), t('Test invalid '));
  }
  public function testPhoneCLFormatting() {

    //$this->assertEqual(format_phone_number('cl', '+6421123456', null), '+64 21 123 456', t('Check international mobile format'));
  }

}

Classes