phone.cl.test 951 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. class CLPhoneNumberTestCase extends DrupalWebTestCase {
  3. /**
  4. * Implementation of getInfo()
  5. *
  6. */
  7. public static function getInfo() {
  8. return array(
  9. 'name' => t('Chili Phone number test'),
  10. 'description' => t('Tests various valid and invalid Chili phone numbers for validity'),
  11. 'group' => t('Phone')
  12. );
  13. }
  14. public function testPhoneCLValid() {
  15. $this->assertTrue(valid_phone_number('cl', '(041)245-9848'), t('Test valid'));
  16. $this->assertTrue(valid_phone_number('cl', '(063)421-232'), t('Test valid'));
  17. }
  18. public function testPhoneCLInvalid() {
  19. $this->assertFalse(valid_phone_number('cl', '0412459848'), t('Test invalid '));
  20. $this->assertFalse(valid_phone_number('cl', '063421232'), t('Test invalid '));
  21. }
  22. public function testPhoneCLFormatting() {
  23. //$this->assertEqual(format_phone_number('cl', '+6421123456', null), '+64 21 123 456', t('Check international mobile format'));
  24. }
  25. }