small bug fixes and code coverage

This commit is contained in:
John Bintz 2009-11-28 11:28:50 -05:00
parent ba6281b2c3
commit fb642f0e85
3 changed files with 15 additions and 7 deletions

View File

@ -1,10 +1,10 @@
<?php
//COMIC CATEGORY -the WordPress ID # of your comic category (default "3")
$comiccat = "58";
$comiccat = "55";
//BLOG CATEGORY - the WordPress ID of your blog category (default "1")
$blogcat = "55";
$blogcat = "58";
//COMIC FOLDER - the folder your comics files are located in (default "comics")
$comic_folder = "comics";

View File

@ -91,6 +91,16 @@ class GraphicalNavigationWidgetTest extends PHPUnit_Framework_TestCase {
$this->w->_group_navigation_buttons(array(), array());
}
function testSetUpPostNavFilterReturnsData() {
_set_filter_expectation('comicpress_set_up_post_nav', array(array(array('test'))));
$w = $this->getMock('GraphicalNavigationWidget', array('_new_comicpress_storyline', '_new_comicpress_navigation'));
$w->expects($this->once())->method('_new_comicpress_storyline')->will($this->returnValue($this->getMock('Storyline', array('set_order_via_flattened_storyline'))));
$w->expects($this->once())->method('_new_comicpress_navigation')->will($this->returnValue($this->getMock('Navigation', array('init', 'get_post_nav'))));
$this->assertEquals('test', $w->set_up_post_nav(array()));
}
function providerTestSetUpPostNavStoryPrev() {
return array(
array(

View File

@ -158,10 +158,6 @@ class GraphicalNavigationWidget extends WP_Widget {
}
}
if (($filter_link = apply_filters('comicpress_display_navigation_link', $link, $which, $current, $target, $instance)) !== false) {
$link = $filter_link;
}
return compact('link', 'navi_class_names');
}
@ -298,8 +294,10 @@ class GraphicalNavigationWidget extends WP_Widget {
}
}
// @codeCoverageIgnoreStart
function _new_comicpress_storyline() { return new ComicPressStoryline(); }
function _new_comicpress_navigation() { return new ComicPressNavigation(); }
// @codeCoverageIgnoreEnd
function set_up_post_nav($instance) {
global $post;
@ -313,7 +311,7 @@ class GraphicalNavigationWidget extends WP_Widget {
$result = apply_filters('comicpress_set_up_post_nav', $post_nav, $post, $instance);
if (is_array($result)) {
return array_shift($result);
return array_shift(array_shift($result));
} else {
return $post_nav;
}