2009-09-27 13:00:29 +00:00
|
|
|
<?php
|
2019-05-28 16:59:38 +00:00
|
|
|
class TipsTest extends ShimmiePHPUnitTestCase
|
|
|
|
{
|
2019-11-14 18:24:09 +00:00
|
|
|
public function setUp(): void
|
2019-05-28 16:59:38 +00:00
|
|
|
{
|
|
|
|
parent::setUp();
|
2015-09-20 21:40:04 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
$this->log_in_as_admin();
|
|
|
|
$this->get_page("tips/list");
|
2015-09-20 21:40:04 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
$this->markTestIncomplete();
|
2015-09-20 21:40:04 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
// get rid of the default data if it's there
|
2019-05-29 17:23:29 +00:00
|
|
|
if (strpos($this->page_to_text(), "Delete")) {
|
2019-05-28 16:59:38 +00:00
|
|
|
$this->click("Delete");
|
|
|
|
}
|
|
|
|
$this->log_out();
|
|
|
|
}
|
2010-03-12 18:34:37 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
public function testImageless()
|
|
|
|
{
|
|
|
|
$this->log_in_as_admin();
|
2010-03-12 18:34:37 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
$this->get_page("tips/list");
|
|
|
|
$this->assert_title("Tips List");
|
2015-09-20 21:40:04 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
$this->markTestIncomplete();
|
2015-09-20 21:40:04 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
$this->set_field("image", "");
|
|
|
|
$this->set_field("text", "an imageless tip");
|
|
|
|
$this->click("Submit");
|
|
|
|
$this->assert_title("Tips List");
|
2010-03-12 18:34:37 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
$this->get_page("post/list");
|
|
|
|
$this->assert_text("an imageless tip");
|
2010-03-12 18:34:37 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
$this->get_page("tips/list");
|
|
|
|
$this->click("Delete");
|
2010-03-12 18:34:37 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
$this->log_out();
|
|
|
|
}
|
2010-03-12 18:34:37 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
public function testImaged()
|
|
|
|
{
|
|
|
|
$this->log_in_as_admin();
|
2010-03-12 18:34:37 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
$this->get_page("tips/list");
|
|
|
|
$this->assert_title("Tips List");
|
2015-09-20 21:40:04 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
$this->markTestIncomplete();
|
2015-09-20 21:40:04 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
$this->set_field("image", "coins.png");
|
|
|
|
$this->set_field("text", "an imaged tip");
|
|
|
|
$this->click("Submit");
|
|
|
|
$this->assert_title("Tips List");
|
2010-03-12 18:34:37 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
$this->get_page("post/list");
|
|
|
|
$this->assert_text("an imaged tip");
|
2010-03-12 18:34:37 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
$this->get_page("tips/list");
|
|
|
|
$this->click("Delete");
|
2010-03-12 18:34:37 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
$this->log_out();
|
|
|
|
}
|
2010-03-12 18:34:37 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
public function testDisabled()
|
|
|
|
{
|
|
|
|
$this->log_in_as_admin();
|
2010-03-12 18:34:37 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
$this->get_page("tips/list");
|
|
|
|
$this->assert_title("Tips List");
|
2015-09-20 21:40:04 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
$this->markTestIncomplete();
|
2015-09-20 21:40:04 +00:00
|
|
|
|
2019-05-28 16:59:38 +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");
|
2010-03-12 18:34:37 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
$this->get_page("post/list");
|
|
|
|
$this->assert_no_text("an imaged tip");
|
2010-03-12 18:34:37 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
$this->get_page("tips/list");
|
|
|
|
$this->click("Delete");
|
2010-03-12 18:34:37 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
$this->log_out();
|
|
|
|
}
|
2009-09-27 13:00:29 +00:00
|
|
|
}
|