Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update URL validator unit tests #2130
  • Loading branch information
lukasbestle authored and bastianallgeier committed Sep 30, 2019
1 parent 45dfdfc commit 72943e3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/Toolkit/VTest.php
Expand Up @@ -371,6 +371,8 @@ public function testUrl()
$this->assertTrue(V::url('http://www.getkirby.com'));
$this->assertTrue(V::url('http://www.getkirby.com/docs/param:value/?foo=bar/#anchor'));
$this->assertTrue(V::url('https://www.getkirby.de.vu'));
$this->assertTrue(V::url('https://getkirby.com:1234'));
$this->assertTrue(V::url('https://getkirby.com:1234/test'));
$this->assertTrue(V::url('http://foo.com/blah_blah'));
$this->assertTrue(V::url('http://foo.com/blah_blah/'));
$this->assertTrue(V::url('http://foo.com/blah_blah_(wikipedia)'));
Expand Down Expand Up @@ -407,12 +409,17 @@ public function testUrl()
$this->assertTrue(V::url('http://1337.net'));
$this->assertTrue(V::url('http://a.b-c.de'));
$this->assertTrue(V::url('http://223.255.255.254'));
// TODO: Find better regex to also cover the following
// $this->assertTrue(V::url('http://special---offer.com/'));
$this->assertTrue(V::url('http://localhost/test/'));
$this->assertTrue(V::url('http://localhost:8080/test'));
$this->assertTrue(V::url('http://127.0.0.1/kirby/'));
$this->assertTrue(V::url('http://127.0.0.1:8080/kirby'));
$this->assertTrue(V::url('https://127.0.0.1/kirby/panel/pages/blog+vvvv'));
$this->assertTrue(V::url('https://localhost/kirby/panel/pages/blog+vvvv'));

// TODO: Find better regex to also cover the following
// $this->assertTrue(V::url('http://special---offer.com/'));
// $this->assertTrue(V::url('http://10.1.1.1'));
// $this->assertTrue(V::url('http://10.1.1.254'));

$this->assertFalse(V::url('foo'));
$this->assertFalse(V::url('http://'));
Expand Down Expand Up @@ -452,8 +459,6 @@ public function testUrl()
$this->assertFalse(V::url('http://.www.foo.bar/'));
$this->assertFalse(V::url('http://www.foo.bar./'));
$this->assertFalse(V::url('http://.www.foo.bar./'));
$this->assertFalse(V::url('http://10.1.1.1'));
$this->assertFalse(V::url('http://10.1.1.254'));
}

public function inputProvider()
Expand Down

0 comments on commit 72943e3

Please sign in to comment.