This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/contrib/favorites/test.php

34 lines
878 B
PHP
Raw Normal View History

2009-07-28 10:45:21 +00:00
<?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");
2009-08-19 00:28:48 +00:00
$this->assert_title("Image $image_id: test");
$this->assert_no_text("Favorited By");
2009-07-28 10:45:21 +00:00
$this->click("Favorite");
2009-08-19 00:28:48 +00:00
$this->assert_text("Favorited By");
2009-07-28 10:45:21 +00:00
$this->get_page("post/list/favorited_by=test/1");
2009-08-19 00:28:48 +00:00
$this->assert_title("Image $image_id: test");
$this->assert_text("Favorited By");
2009-07-28 10:45:21 +00:00
$this->get_page("user/test");
2009-08-19 00:28:48 +00:00
$this->assert_text("Images favorited: 1");
$this->click("Images favorited");
2009-08-19 00:28:48 +00:00
$this->assert_title("Image $image_id: test");
2009-07-28 10:45:21 +00:00
$this->click("Un-Favorite");
2009-08-19 00:28:48 +00:00
$this->assert_no_text("Favorited By");
2009-07-28 10:45:21 +00:00
$this->log_out();
$this->log_in_as_admin();
$this->delete_image($image_id);
$this->log_out();
}
}
?>