Adding tests for #3288

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5782 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
mariano.iglesias 2007-10-17 21:45:24 +00:00
parent a207a95893
commit 7305d48215

View file

@ -1192,7 +1192,19 @@ class ValidationTestCase extends UnitTestCase {
}
function testUrl() {
$this->assertTrue($this->Validation->url('http://www.cakephp.org'));
$this->assertTrue($this->Validation->url('http://www.cakephp.org/somewhere#anchor'));
$this->assertTrue($this->Validation->url('http://192.168.0.1'));
$this->assertTrue($this->Validation->url('ftps://192.168.0.1/pub/cake'));
$this->assertFalse($this->Validation->url('ftp://256.168.0.1/pub/cake'));
$this->assertTrue($this->Validation->url('https://my.gizmoproject.com/gizmo/app?class=MySip;proc=start'));
$this->assertTrue($this->Validation->url('www.domain.tld'));
$this->assertFalse($this->Validation->url('http://w_w.micr_soft.co_m'));
$this->assertFalse($this->Validation->url('http://www.domain.12com'));
$this->assertFalse($this->Validation->url('http://www.domain.longttldnotallowed'));
$this->assertFalse($this->Validation->url('http://www.-invaliddomain.tld'));
$this->assertFalse($this->Validation->url('http://www.domain.-invalidtld'));
$this->assertFalse($this->Validation->url('http://www.this-domain-is-just-too-long-and-inacceptable-by-icann-rules-the-maximum-limit-of-characters-is-57.com'));
}
function testValidNumber() {