2009-09-27 13:00:29 +00:00
|
|
|
<?php
|
2015-09-20 21:40:04 +00:00
|
|
|
class TipsTest extends ShimmiePHPUnitTestCase {
|
2015-09-26 10:17:13 +00:00
|
|
|
public function setUp() {
|
2015-09-20 21:40:04 +00:00
|
|
|
parent::setUp();
|
|
|
|
|
2009-09-27 13:00:29 +00:00
|
|
|
$this->log_in_as_admin();
|
2015-09-20 21:40:04 +00:00
|
|
|
$this->get_page("tips/list");
|
|
|
|
|
2015-09-21 09:05:32 +00:00
|
|
|
$this->markTestIncomplete();
|
2015-09-20 21:40:04 +00:00
|
|
|
|
2010-03-12 18:34:37 +00:00
|
|
|
// get rid of the default data if it's there
|
|
|
|
if(strpos($raw, "Delete")) {
|
|
|
|
$this->click("Delete");
|
|
|
|
}
|
|
|
|
$this->log_out();
|
|
|
|
}
|
|
|
|
|
2015-09-26 10:17:13 +00:00
|
|
|
public function testImageless() {
|
2010-03-12 18:34:37 +00:00
|
|
|
$this->log_in_as_admin();
|
|
|
|
|
|
|
|
$this->get_page("tips/list");
|
|
|
|
$this->assert_title("Tips List");
|
2015-09-20 21:40:04 +00:00
|
|
|
|
2015-09-21 09:05:32 +00:00
|
|
|
$this->markTestIncomplete();
|
2015-09-20 21:40:04 +00:00
|
|
|
|
2010-03-12 18:34:37 +00:00
|
|
|
$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();
|
|
|
|
}
|
|
|
|
|
2015-09-26 10:17:13 +00:00
|
|
|
public function testImaged() {
|
2010-03-12 18:34:37 +00:00
|
|
|
$this->log_in_as_admin();
|
|
|
|
|
2009-09-27 13:00:29 +00:00
|
|
|
$this->get_page("tips/list");
|
|
|
|
$this->assert_title("Tips List");
|
2015-09-20 21:40:04 +00:00
|
|
|
|
2015-09-21 09:05:32 +00:00
|
|
|
$this->markTestIncomplete();
|
2015-09-20 21:40:04 +00:00
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
2015-09-26 10:17:13 +00:00
|
|
|
public function testDisabled() {
|
2010-03-12 18:34:37 +00:00
|
|
|
$this->log_in_as_admin();
|
|
|
|
|
|
|
|
$this->get_page("tips/list");
|
|
|
|
$this->assert_title("Tips List");
|
2015-09-20 21:40:04 +00:00
|
|
|
|
2015-09-21 09:05:32 +00:00
|
|
|
$this->markTestIncomplete();
|
2015-09-20 21:40:04 +00:00
|
|
|
|
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->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();
|
|
|
|
}
|
|
|
|
}
|
2014-04-26 02:54:51 +00:00
|
|
|
|