diff options
Diffstat (limited to 'tests/unit/db/ItemTest.php')
-rw-r--r-- | tests/unit/db/ItemTest.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/unit/db/ItemTest.php b/tests/unit/db/ItemTest.php index d48c8da12..971d808f0 100644 --- a/tests/unit/db/ItemTest.php +++ b/tests/unit/db/ItemTest.php @@ -71,7 +71,7 @@ class ItemTest extends \PHPUnit_Framework_TestCase { $item->setId(3); $item->setGuid('guid'); $item->setGuidHash('hash'); - $item->setUrl('url'); + $item->setUrl('https://google'); $item->setTitle('title'); $item->setAuthor('author'); $item->setPubDate(123); @@ -88,7 +88,7 @@ class ItemTest extends \PHPUnit_Framework_TestCase { 'id' => 3, 'guid' => 'guid', 'guidHash' => 'hash', - 'url' => 'url', + 'url' => 'https://google', 'title' => 'title', 'author' => 'author', 'pubDate' => 123, @@ -119,4 +119,11 @@ class ItemTest extends \PHPUnit_Framework_TestCase { } + public function testSetXSSUrl() { + $item = new Item(); + $item->setUrl('javascript:alert()'); + $this->assertEquals('', $item->getUrl()); + } + + }
\ No newline at end of file |