aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/LinkDBTest.php
diff options
context:
space:
mode:
authorVirtualTam <virtualtam@flibidi.net>2015-06-27 14:57:44 +0200
committerVirtualTam <virtualtam@flibidi.net>2015-07-09 00:44:19 +0200
commit9186ab95943b7c2467a0f27f30bed9db3c589b9d (patch)
treecfc8e4d2c8469ac16910c18d59a07b23d0348fbe /tests/LinkDBTest.php
parent46d83c20d77276e9e94c54e31b29222f762e13dd (diff)
downloadShaarli-9186ab95943b7c2467a0f27f30bed9db3c589b9d.tar.gz
Shaarli-9186ab95943b7c2467a0f27f30bed9db3c589b9d.tar.zst
Shaarli-9186ab95943b7c2467a0f27f30bed9db3c589b9d.zip
LinkDB::filterDay(): check input date format
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Diffstat (limited to 'tests/LinkDBTest.php')
-rw-r--r--tests/LinkDBTest.php23
1 files changed, 13 insertions, 10 deletions
diff --git a/tests/LinkDBTest.php b/tests/LinkDBTest.php
index ee8dbee3..8b0bd23b 100644
--- a/tests/LinkDBTest.php
+++ b/tests/LinkDBTest.php
@@ -396,19 +396,22 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
396 396
397 /** 397 /**
398 * Use an invalid date format 398 * Use an invalid date format
399 * @expectedException Exception
400 * @expectedExceptionMessageRegExp /Invalid date format/
399 */ 401 */
400 public function testFilterInvalidDay() 402 public function testFilterInvalidDayWithChars()
401 { 403 {
402 $this->assertEquals( 404 self::$privateLinkDB->filterDay('Rainy day, dream away');
403 0, 405 }
404 sizeof(self::$privateLinkDB->filterDay('Rainy day, dream away'))
405 );
406 406
407 // TODO: check input format 407 /**
408 $this->assertEquals( 408 * Use an invalid date format
409 6, 409 * @expectedException Exception
410 sizeof(self::$privateLinkDB->filterDay('20')) 410 * @expectedExceptionMessageRegExp /Invalid date format/
411 ); 411 */
412 public function testFilterInvalidDayDigits()
413 {
414 self::$privateLinkDB->filterDay('20');
412 } 415 }
413 416
414 /** 417 /**