X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FUpdater%2FUpdaterTest.php;h=d865066b99f9aa923bafbee30f9ce90b264de9d8;hb=07c2f73543b358d39b3751c8542966794f28db03;hp=63ed5e0364d0c19b977b3012dbb56445c663b663;hpb=6cbff7e80f272d4a3bbd266b49efcd3607b7e1bd;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/Updater/UpdaterTest.php b/tests/Updater/UpdaterTest.php index 63ed5e03..d865066b 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,15 @@ 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(); + $this->assertNotEmpty($linkDB->filter(LinkFilter::$FILTER_TAG, 'exclude')); + } }