+
+ /**
+ * Test filterHash() with an invalid smallhash.
+ *
+ * @expectedException LinkNotFoundException
+ */
+ public function testFilterHashInValid1()
+ {
+ $request = 'blabla';
+ self::$publicLinkDB->filterHash($request);
+ }
+
+ /**
+ * Test filterHash() with an empty smallhash.
+ *
+ * @expectedException LinkNotFoundException
+ */
+ public function testFilterHashInValid()
+ {
+ self::$publicLinkDB->filterHash('');
+ }
+
+ /**
+ * Test reorder with asc/desc parameter.
+ */
+ public function testReorderLinksDesc()
+ {
+ self::$privateLinkDB->reorder('ASC');
+ $linkIds = array(42, 4, 1, 0, 7, 6, 8, 41);
+ $cpt = 0;
+ foreach (self::$privateLinkDB as $key => $value) {
+ $this->assertEquals($linkIds[$cpt++], $key);
+ }
+ self::$privateLinkDB->reorder('DESC');
+ $linkIds = array_reverse($linkIds);
+ $cpt = 0;
+ foreach (self::$privateLinkDB as $key => $value) {
+ $this->assertEquals($linkIds[$cpt++], $key);
+ }
+ }