aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Updater/UpdaterTest.php
diff options
context:
space:
mode:
authorArthur <arthur@hoa.ro>2016-02-15 21:12:39 +0100
committerArthur <arthur@hoa.ro>2016-02-15 21:12:39 +0100
commit1e7331126d81a5759ab91c221f7e0f164aeebfb5 (patch)
treea5d084066e1e49fae01ae72f102b3eab2fb6d8ac /tests/Updater/UpdaterTest.php
parent6e607ca613b47e17f7516e94adfee930d4f3e1e8 (diff)
parentce354bf1a61ce2478529ad558b24cdf9678c398a (diff)
downloadShaarli-1e7331126d81a5759ab91c221f7e0f164aeebfb5.tar.gz
Shaarli-1e7331126d81a5759ab91c221f7e0f164aeebfb5.tar.zst
Shaarli-1e7331126d81a5759ab91c221f7e0f164aeebfb5.zip
Merge pull request #446 from ArthurHoaro/search-tag-exclude
Add exclusion in tag search
Diffstat (limited to 'tests/Updater/UpdaterTest.php')
-rw-r--r--tests/Updater/UpdaterTest.php18
1 files changed, 18 insertions, 0 deletions
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
@@ -14,6 +14,11 @@ class UpdaterTest extends PHPUnit_Framework_TestCase
14 private static $configFields; 14 private static $configFields;
15 15
16 /** 16 /**
17 * @var string Path to test datastore.
18 */
19 protected static $testDatastore = 'sandbox/datastore.php';
20
21 /**
17 * Executed before each test. 22 * Executed before each test.
18 */ 23 */
19 public function setUp() 24 public function setUp()
@@ -31,6 +36,7 @@ class UpdaterTest extends PHPUnit_Framework_TestCase
31 'config' => array( 36 'config' => array(
32 'CONFIG_FILE' => 'tests/Updater/config.php', 37 'CONFIG_FILE' => 'tests/Updater/config.php',
33 'DATADIR' => 'tests/Updater', 38 'DATADIR' => 'tests/Updater',
39 'PAGECACHE' => 'sandbox/pagecache',
34 'config1' => 'config1data', 40 'config1' => 'config1data',
35 'config2' => 'config2data', 41 'config2' => 'config2data',
36 ) 42 )
@@ -224,4 +230,16 @@ class UpdaterTest extends PHPUnit_Framework_TestCase
224 include self::$configFields['config']['CONFIG_FILE']; 230 include self::$configFields['config']['CONFIG_FILE'];
225 $this->assertEquals(self::$configFields['login'], $GLOBALS['login']); 231 $this->assertEquals(self::$configFields['login'], $GLOBALS['login']);
226 } 232 }
233
234 public function testRenameDashTags()
235 {
236 $refDB = new ReferenceLinkDB();
237 $refDB->write(self::$testDatastore);
238 $linkDB = new LinkDB(self::$testDatastore, true, false);
239 $this->assertEmpty($linkDB->filter(LinkFilter::$FILTER_TAG, 'exclude'));
240 $updater = new Updater(array(), self::$configFields, $linkDB, true);
241 $updater->updateMethodRenameDashTags();
242 var_dump($linkDB->filter(LinkFilter::$FILTER_TAG, 'exclude'));
243 $this->assertNotEmpty($linkDB->filter(LinkFilter::$FILTER_TAG, 'exclude'));
244 }
227} 245}