diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/LinkDBTest.php | 31 | ||||
-rw-r--r-- | tests/Updater/UpdaterTest.php | 40 |
2 files changed, 29 insertions, 42 deletions
diff --git a/tests/LinkDBTest.php b/tests/LinkDBTest.php index 7bf98f92..2523467d 100644 --- a/tests/LinkDBTest.php +++ b/tests/LinkDBTest.php | |||
@@ -297,7 +297,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase | |||
297 | 'sTuff' => 2, | 297 | 'sTuff' => 2, |
298 | 'ut' => 1, | 298 | 'ut' => 1, |
299 | ), | 299 | ), |
300 | self::$publicLinkDB->allTags() | 300 | self::$publicLinkDB->linksCountPerTag() |
301 | ); | 301 | ); |
302 | 302 | ||
303 | $this->assertEquals( | 303 | $this->assertEquals( |
@@ -325,7 +325,34 @@ class LinkDBTest extends PHPUnit_Framework_TestCase | |||
325 | 'tag4' => 1, | 325 | 'tag4' => 1, |
326 | 'ut' => 1, | 326 | 'ut' => 1, |
327 | ), | 327 | ), |
328 | self::$privateLinkDB->allTags() | 328 | self::$privateLinkDB->linksCountPerTag() |
329 | ); | ||
330 | $this->assertEquals( | ||
331 | array( | ||
332 | 'web' => 4, | ||
333 | 'cartoon' => 2, | ||
334 | 'gnu' => 1, | ||
335 | 'dev' => 1, | ||
336 | 'samba' => 1, | ||
337 | 'media' => 1, | ||
338 | 'html' => 1, | ||
339 | 'w3c' => 1, | ||
340 | 'css' => 1, | ||
341 | 'Mercurial' => 1, | ||
342 | '.hidden' => 1, | ||
343 | 'hashtag' => 1, | ||
344 | ), | ||
345 | self::$privateLinkDB->linksCountPerTag(['web']) | ||
346 | ); | ||
347 | $this->assertEquals( | ||
348 | array( | ||
349 | 'web' => 1, | ||
350 | 'html' => 1, | ||
351 | 'w3c' => 1, | ||
352 | 'css' => 1, | ||
353 | 'Mercurial' => 1, | ||
354 | ), | ||
355 | self::$privateLinkDB->linksCountPerTag(['web'], 'private') | ||
329 | ); | 356 | ); |
330 | } | 357 | } |
331 | 358 | ||
diff --git a/tests/Updater/UpdaterTest.php b/tests/Updater/UpdaterTest.php index 11b6444a..fed175df 100644 --- a/tests/Updater/UpdaterTest.php +++ b/tests/Updater/UpdaterTest.php | |||
@@ -470,46 +470,6 @@ $GLOBALS[\'privateLinkByDefault\'] = true;'; | |||
470 | } | 470 | } |
471 | 471 | ||
472 | /** | 472 | /** |
473 | * Test updateMethodDefaultThemeVintage with the default theme enabled. | ||
474 | */ | ||
475 | public function testSetDefaultThemeToVintage() | ||
476 | { | ||
477 | $sandboxConf = 'sandbox/config'; | ||
478 | copy(self::$configFile . '.json.php', $sandboxConf . '.json.php'); | ||
479 | $this->conf = new ConfigManager($sandboxConf); | ||
480 | |||
481 | $this->conf->set('resource.theme', 'default'); | ||
482 | $updater = new Updater([], [], $this->conf, true); | ||
483 | $this->assertTrue($updater->updateMethodDefaultThemeVintage()); | ||
484 | $this->assertEquals('vintage', $this->conf->get('resource.theme')); | ||
485 | |||
486 | // reload from file | ||
487 | $this->conf = new ConfigManager($sandboxConf); | ||
488 | $this->assertEquals('vintage', $this->conf->get('resource.theme')); | ||
489 | } | ||
490 | |||
491 | /** | ||
492 | * Test updateMethodDefaultThemeVintage with custom theme enabled => nothing to do. | ||
493 | */ | ||
494 | public function testSetDefaultThemeNothingToDo() | ||
495 | { | ||
496 | $sandboxConf = 'sandbox/config'; | ||
497 | copy(self::$configFile . '.json.php', $sandboxConf . '.json.php'); | ||
498 | $this->conf = new ConfigManager($sandboxConf); | ||
499 | |||
500 | $theme = 'myawesometheme'; | ||
501 | $this->conf->set('resource.theme', $theme); | ||
502 | $this->conf->write(true); | ||
503 | $updater = new Updater([], [], $this->conf, true); | ||
504 | $this->assertTrue($updater->updateMethodDefaultThemeVintage()); | ||
505 | $this->assertEquals($theme, $this->conf->get('resource.theme')); | ||
506 | |||
507 | // reload from file | ||
508 | $this->conf = new ConfigManager($sandboxConf); | ||
509 | $this->assertEquals($theme, $this->conf->get('resource.theme')); | ||
510 | } | ||
511 | |||
512 | /** | ||
513 | * Test updateMethodEscapeMarkdown with markdown plugin enabled | 473 | * Test updateMethodEscapeMarkdown with markdown plugin enabled |
514 | * => setting markdown_escape set to false. | 474 | * => setting markdown_escape set to false. |
515 | */ | 475 | */ |