aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/LinkDBTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/LinkDBTest.php')
-rw-r--r--tests/LinkDBTest.php27
1 files changed, 15 insertions, 12 deletions
diff --git a/tests/LinkDBTest.php b/tests/LinkDBTest.php
index ee8dbee3..d34ea4f5 100644
--- a/tests/LinkDBTest.php
+++ b/tests/LinkDBTest.php
@@ -103,7 +103,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
103 unlink(self::$testDatastore); 103 unlink(self::$testDatastore);
104 $this->assertFileNotExists(self::$testDatastore); 104 $this->assertFileNotExists(self::$testDatastore);
105 105
106 $checkDB = self::getMethod('checkDB'); 106 $checkDB = self::getMethod('_checkDB');
107 $checkDB->invokeArgs($linkDB, array()); 107 $checkDB->invokeArgs($linkDB, array());
108 $this->assertFileExists(self::$testDatastore); 108 $this->assertFileExists(self::$testDatastore);
109 109
@@ -120,7 +120,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
120 $datastoreSize = filesize(self::$testDatastore); 120 $datastoreSize = filesize(self::$testDatastore);
121 $this->assertGreaterThan(0, $datastoreSize); 121 $this->assertGreaterThan(0, $datastoreSize);
122 122
123 $checkDB = self::getMethod('checkDB'); 123 $checkDB = self::getMethod('_checkDB');
124 $checkDB->invokeArgs($linkDB, array()); 124 $checkDB->invokeArgs($linkDB, array());
125 125
126 // ensure the datastore is left unmodified 126 // ensure the datastore is left unmodified
@@ -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 /**