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/numeric_score/test.php

25 lines
725 B
PHP
Raw Normal View History

2009-07-20 05:51:36 +00:00
<?php
class NumericScoreTest extends ShimmieWebTestCase {
function testNumericScore() {
$this->log_in_as_user();
2009-08-13 16:48:28 +00:00
$image_id = $this->post_image("ext/simpletest/data/pbx_screenshot.jpg", "pbx");
2009-07-20 05:51:36 +00:00
$this->get_page("post/view/$image_id");
$this->assertText("Current Score: 0");
$this->click("Vote Down");
$this->assertText("Current Score: -1");
$this->click("Vote Up");
$this->assertText("Current Score: 1");
# FIXME: "remove vote" button?
# FIXME: test that up and down are hidden if already voted up or down
2009-08-13 16:48:28 +00:00
$this->get_page("post/list/score=1/1");
$this->assertTitle("Image $image_id: pbx");
2009-07-20 05:51:36 +00:00
$this->log_out();
$this->log_in_as_admin();
$this->delete_image($image_id);
$this->log_out();
}
}
?>