Ejemplo n.º 1
0
 public function testGetAvailableCountries()
 {
     $countries = ZipCode::getAvailableCountries();
     $this->assertTrue(is_array($countries));
     $this->assertContains('FR', $countries);
     $this->assertContains('US', $countries);
 }
Ejemplo n.º 2
0
 public function testEmptyValuesByCountry()
 {
     foreach (ZipCode::getAvailableCountries() as $country) {
         foreach ($this->getEmptyValues() as $value) {
             $this->assertFalse(ZipCode::validate($value, $country), 'Empty value should be invalid.');
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * testUSZipCode
  *
  * @param mixed  $code
  * @param string $country
  * @param bool   $result
  *
  * @dataProvider zipCodes
  *
  * @return void
  */
 public function testUSZipCode($code, $country, $result)
 {
     $this->assertEquals(ZipCode::validate($code, $country), $result);
 }