favorites testing and tweak
This commit is contained in:
parent
77368cb03b
commit
5f106b0950
28
contrib/favorites/test.php
Normal file
28
contrib/favorites/test.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
class FavoritesTest extends ShimmieWebTestCase {
|
||||
function testFavorites() {
|
||||
$this->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();
|
||||
}
|
||||
}
|
||||
?>
|
@ -36,7 +36,7 @@ class FavoritesTheme extends Themelet {
|
||||
$html .= "<br><a href='".make_link("user/$username")."'>$username</a>";
|
||||
}
|
||||
|
||||
$page->add_block(new Block("Favorited by", $html, "left", 25));
|
||||
$page->add_block(new Block("Favorited By", $html, "left", 25));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user