phone.pl.test 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. class PLPhoneNumberTestCase extends DrupalWebTestCase {
  3. /**
  4. * Implementation of getInfo()
  5. *
  6. */
  7. public static function getInfo() {
  8. return array(
  9. 'name' => t('Poland Phone number test'),
  10. 'description' => t('Tests various valid and invalid Poland phone numbers for validity'),
  11. 'group' => t('Phone')
  12. );
  13. }
  14. public function testPhonePLValid() {
  15. $this->assertTrue(valid_phone_number('pl', '+48 500-080-100'), t('Test valid'));
  16. $this->assertTrue(valid_phone_number('pl', '500080100'), t('Test valid'));
  17. $this->assertTrue(valid_phone_number('pl', '500 080 100'), t('Test valid'));
  18. }
  19. public function testPhonePLInvalid() {
  20. $this->assertFalse(valid_phone_number('pl', '+47 100-100-100'), t('Test invalid '));
  21. $this->assertFalse(valid_phone_number('pl', '1000-100-100'), t('Test invalid '));
  22. $this->assertFalse(valid_phone_number('pl', '1000000000'), t('Test invalid '));
  23. }
  24. public function testPhonePLFormatting() {
  25. //$this->assertEqual(format_phone_number('pl', '+6421123456', null), '+64 21 123 456', t('Check international mobile format'));
  26. }
  27. }