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

72 lines
1.5 KiB
PHP
Raw Normal View History

2009-09-27 13:00:29 +00:00
<?php
class TipsTest extends SCoreWebTestCase {
2010-03-12 18:34:37 +00:00
function setUp() {
2009-09-27 13:00:29 +00:00
$this->log_in_as_admin();
2010-03-12 18:34:37 +00:00
$raw = $this->get_page("tips/list");
// get rid of the default data if it's there
if(strpos($raw, "Delete")) {
$this->click("Delete");
}
$this->log_out();
}
function testImageless() {
$this->log_in_as_admin();
$this->get_page("tips/list");
$this->assert_title("Tips List");
$this->set_field("image", "");
$this->set_field("text", "an imageless tip");
$this->click("Submit");
$this->assert_title("Tips List");
$this->get_page("post/list");
$this->assert_text("an imageless tip");
$this->get_page("tips/list");
$this->click("Delete");
$this->log_out();
}
function testImaged() {
$this->log_in_as_admin();
2009-09-27 13:00:29 +00:00
$this->get_page("tips/list");
$this->assert_title("Tips List");
2010-03-12 18:34:37 +00:00
$this->set_field("image", "coins.png");
$this->set_field("text", "an imaged tip");
$this->click("Submit");
$this->assert_title("Tips List");
$this->get_page("post/list");
$this->assert_text("an imaged tip");
$this->get_page("tips/list");
$this->click("Delete");
$this->log_out();
}
function testDisabled() {
$this->log_in_as_admin();
$this->get_page("tips/list");
$this->assert_title("Tips List");
$this->set_field("image", "coins.png");
$this->set_field("text", "an imaged tip");
$this->click("Submit");
$this->click("Yes");
$this->assert_title("Tips List");
$this->get_page("post/list");
$this->assert_no_text("an imaged tip");
$this->get_page("tips/list");
$this->click("Delete");
2009-09-27 13:00:29 +00:00
$this->log_out();
}
}
?>