public function testEmptyValuesByCountry() { foreach (ZipCode::getAvailableCountries() as $country) { foreach ($this->getEmptyValues() as $value) { $this->assertFalse(ZipCode::validate($value, $country), 'Empty value should be invalid.'); } } }
/** * 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); }
/** * testZipCodeException * * @expectedException InvalidArgumentException * * @return void */ public function testZipCodeException() { $this->assertEquals(ZipCode::validate('ABC12', 'Unkown'), $result); }