X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FUpdater%2FUpdaterTest.php;h=84b82350390fbc207b14d483a53f6fe41b610096;hb=21979ff11ceee0042642ac17147858a4155d54c5;hp=63ed5e0364d0c19b977b3012dbb56445c663b663;hpb=6e607ca613b47e17f7516e94adfee930d4f3e1e8;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/Updater/UpdaterTest.php b/tests/Updater/UpdaterTest.php index 63ed5e03..84b82350 100644 --- a/tests/Updater/UpdaterTest.php +++ b/tests/Updater/UpdaterTest.php @@ -13,6 +13,11 @@ class UpdaterTest extends PHPUnit_Framework_TestCase */ private static $configFields; + /** + * @var string Path to test datastore. + */ + protected static $testDatastore = 'sandbox/datastore.php'; + /** * Executed before each test. */ @@ -31,6 +36,7 @@ class UpdaterTest extends PHPUnit_Framework_TestCase 'config' => array( 'CONFIG_FILE' => 'tests/Updater/config.php', 'DATADIR' => 'tests/Updater', + 'PAGECACHE' => 'sandbox/pagecache', 'config1' => 'config1data', 'config2' => 'config2data', ) @@ -224,4 +230,16 @@ class UpdaterTest extends PHPUnit_Framework_TestCase include self::$configFields['config']['CONFIG_FILE']; $this->assertEquals(self::$configFields['login'], $GLOBALS['login']); } + + public function testRenameDashTags() + { + $refDB = new ReferenceLinkDB(); + $refDB->write(self::$testDatastore); + $linkDB = new LinkDB(self::$testDatastore, true, false); + $this->assertEmpty($linkDB->filter(LinkFilter::$FILTER_TAG, 'exclude')); + $updater = new Updater(array(), self::$configFields, $linkDB, true); + $updater->updateMethodRenameDashTags(); + var_dump($linkDB->filter(LinkFilter::$FILTER_TAG, 'exclude')); + $this->assertNotEmpty($linkDB->filter(LinkFilter::$FILTER_TAG, 'exclude')); + } }