phone.il.test 820 B

123456789101112131415161718192021222324252627
  1. <?php
  2. class ILPhoneNumberTestCase extends DrupalWebTestCase {
  3. /**
  4. * Implementation of getInfo()
  5. *
  6. */
  7. public static function getInfo() {
  8. return array(
  9. 'name' => t('Israel Phone number test'),
  10. 'description' => t('Tests various valid and invalid Israel phone numbers for validity'),
  11. 'group' => t('Phone')
  12. );
  13. }
  14. public function testPhoneILValid() {
  15. $this->assertTrue(valid_phone_number('il', '1800 999 999'), '"1800 999 999" should be valid');
  16. }
  17. public function testPhoneILInvalid() {
  18. //$this->assertFalse(valid_phone_number('il', '021 3012 3456'), t('Test invalid'));
  19. }
  20. public function testPhoneILFormatting() {
  21. $this->assertEqual(format_phone_number('il', '1800 999 999', null), '1800 999 999', 'Formatting OK "1800 999 999" --> "1800 999 999"');
  22. }
  23. }