From 5f106b095082867a60bbd75fbc414c5e063d57cc Mon Sep 17 00:00:00 2001 From: Shish Date: Tue, 28 Jul 2009 11:45:21 +0100 Subject: [PATCH] favorites testing and tweak --- contrib/favorites/test.php | 28 ++++++++++++++++++++++++++++ contrib/favorites/theme.php | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 contrib/favorites/test.php diff --git a/contrib/favorites/test.php b/contrib/favorites/test.php new file mode 100644 index 00000000..7ec31f7a --- /dev/null +++ b/contrib/favorites/test.php @@ -0,0 +1,28 @@ +log_in_as_user(); + $image_id = $this->post_image("ext/simpletest/data/pbx_screenshot.jpg", "test"); + + $this->get_page("post/view/$image_id"); + $this->assertTitle("Image $image_id: test"); + $this->assertNoText("Favorited By"); + + $this->click("Favorite"); + $this->assertText("Favorited By"); + + $this->get_page("post/list/favorited_by=test/1"); + $this->assertTitle("Image $image_id: test"); + $this->assertText("Favorited By"); + + $this->click("Un-Favorite"); + $this->assertNoText("Favorited By"); + + $this->log_out(); + + $this->log_in_as_admin(); + $this->delete_image($image_id); + $this->log_out(); + } +} +?> diff --git a/contrib/favorites/theme.php b/contrib/favorites/theme.php index 935c665e..eb283006 100644 --- a/contrib/favorites/theme.php +++ b/contrib/favorites/theme.php @@ -36,7 +36,7 @@ class FavoritesTheme extends Themelet { $html .= "
$username"; } - $page->add_block(new Block("Favorited by", $html, "left", 25)); + $page->add_block(new Block("Favorited By", $html, "left", 25)); } }