From 85844be3e88f1160d5bdfd303aa5c6dbf987063b Mon Sep 17 00:00:00 2001 From: John Bintz Date: Sun, 29 Nov 2009 16:02:45 -0500 Subject: [PATCH] cleanup comic title and add test --- test/widgets/DisplayComicTitleWidgetTest.php | 24 +++++++++++ widgets/DisplayComicTitleWidget.inc | 25 +++++++++++ widgets/comictitle.php | 45 -------------------- 3 files changed, 49 insertions(+), 45 deletions(-) create mode 100644 test/widgets/DisplayComicTitleWidgetTest.php create mode 100644 widgets/DisplayComicTitleWidget.inc delete mode 100644 widgets/comictitle.php diff --git a/test/widgets/DisplayComicTitleWidgetTest.php b/test/widgets/DisplayComicTitleWidgetTest.php new file mode 100644 index 0000000..d2ab470 --- /dev/null +++ b/test/widgets/DisplayComicTitleWidgetTest.php @@ -0,0 +1,24 @@ + 'title', + 'guid' => 'link' + ); + + $w = new DisplayComicTitleWidget(); + + ob_start(); + $w->widget(array('before_widget' => '', 'after_widget' => ''), array()); + $result = ob_get_clean(); + + $this->assertEquals('title', $result); + } +} diff --git a/widgets/DisplayComicTitleWidget.inc b/widgets/DisplayComicTitleWidget.inc new file mode 100644 index 0000000..29d4c4b --- /dev/null +++ b/widgets/DisplayComicTitleWidget.inc @@ -0,0 +1,25 @@ + 'DisplayComicTitleWidget', 'description' => __('Displays the title of the comic. (used in comic sidebars)','comicpress') ); + $this->WP_Widget('comictitle', __('Comic Title','comicpress'), $widget_ops); + } + + function widget($args, $instance) { + extract($args, EXTR_SKIP); + + echo $before_widget; + ?> 'widget_comicpress_comictitle', 'description' => __('Displays the title of the comic. (used in comic sidebars)','comicpress') ); - $this->WP_Widget('comictitle', __('Comic Title','comicpress'), $widget_ops); - } - - function widget($args, $instance) { - global $post; - extract($args, EXTR_SKIP); - - echo $before_widget;?> - - \ No newline at end of file