2009-07-28 11:45:21 +01:00
|
|
|
<?php
|
2019-05-28 17:59:38 +01:00
|
|
|
class FavoritesTest extends ShimmiePHPUnitTestCase
|
|
|
|
{
|
|
|
|
public function testFavorites()
|
|
|
|
{
|
|
|
|
$this->log_in_as_user();
|
|
|
|
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "test");
|
2009-07-28 11:45:21 +01:00
|
|
|
|
2019-05-28 17:59:38 +01:00
|
|
|
$this->get_page("post/view/$image_id");
|
|
|
|
$this->assert_title("Image $image_id: test");
|
|
|
|
$this->assert_no_text("Favorited By");
|
2009-07-28 11:45:21 +01:00
|
|
|
|
2019-05-28 17:59:38 +01:00
|
|
|
$this->markTestIncomplete();
|
2015-09-21 10:05:32 +01:00
|
|
|
|
2019-05-28 17:59:38 +01:00
|
|
|
$this->click("Favorite");
|
|
|
|
$this->assert_text("Favorited By");
|
2009-07-28 11:45:21 +01:00
|
|
|
|
2019-05-28 17:59:38 +01:00
|
|
|
$this->get_page("post/list/favorited_by=test/1");
|
|
|
|
$this->assert_title("Image $image_id: test");
|
|
|
|
$this->assert_text("Favorited By");
|
2009-07-28 11:45:21 +01:00
|
|
|
|
2019-05-28 17:59:38 +01:00
|
|
|
$this->get_page("user/test");
|
|
|
|
$this->assert_text("Images favorited: 1");
|
|
|
|
$this->click("Images favorited");
|
|
|
|
$this->assert_title("Image $image_id: test");
|
2009-08-18 22:30:52 +01:00
|
|
|
|
2019-05-28 17:59:38 +01:00
|
|
|
$this->click("Un-Favorite");
|
|
|
|
$this->assert_no_text("Favorited By");
|
|
|
|
}
|
2009-07-28 11:45:21 +01:00
|
|
|
}
|