Image to Post - tips

This commit is contained in:
Matthew Barbour 2020-10-26 10:20:49 -05:00
parent eecb737501
commit df4f2821b2
2 changed files with 12 additions and 12 deletions

View File

@ -17,14 +17,14 @@ class TipsTest extends ShimmiePHPUnitTestCase
$this->get_page("tips/list");
$this->assert_title("Tips List");
send_event(new CreateTipEvent(true, "", "an imageless tip"));
send_event(new CreateTipEvent(true, "", "a postless tip"));
$this->get_page("post/list");
$this->assert_text("an imageless tip");
$this->assert_text("a postless tip");
$tip_id = (int)$database->get_one("SELECT id FROM tips");
send_event(new DeleteTipEvent($tip_id));
$this->get_page("post/list");
$this->assert_no_text("an imageless tip");
$this->assert_no_text("a postless tip");
}
public function testImaged()
@ -35,14 +35,14 @@ class TipsTest extends ShimmiePHPUnitTestCase
$this->get_page("tips/list");
$this->assert_title("Tips List");
send_event(new CreateTipEvent(true, "coins.png", "an imageless tip"));
send_event(new CreateTipEvent(true, "coins.png", "a postless tip"));
$this->get_page("post/list");
$this->assert_text("an imageless tip");
$this->assert_text("a postless tip");
$tip_id = (int)$database->get_one("SELECT id FROM tips");
send_event(new DeleteTipEvent($tip_id));
$this->get_page("post/list");
$this->assert_no_text("an imageless tip");
$this->assert_no_text("a postless tip");
}
public function testDisabled()
@ -53,13 +53,13 @@ class TipsTest extends ShimmiePHPUnitTestCase
$this->get_page("tips/list");
$this->assert_title("Tips List");
send_event(new CreateTipEvent(false, "", "an imageless tip"));
send_event(new CreateTipEvent(false, "", "a postless tip"));
$this->get_page("post/list");
$this->assert_no_text("an imageless tip");
$this->assert_no_text("a postless tip");
$tip_id = (int)$database->get_one("SELECT id FROM tips");
send_event(new DeleteTipEvent($tip_id));
$this->get_page("post/list");
$this->assert_no_text("an imageless tip");
$this->assert_no_text("a postless tip");
}
}

View File

@ -4,7 +4,7 @@ class TipsTheme extends Themelet
public function manageTips($url, $images)
{
global $page;
$select = "<select name='image'><option value=''>- Select Image -</option>";
$select = "<select name='image'><option value=''>- Select Post -</option>";
foreach ($images as $image) {
$select .= "<option style='background-image:url(".$url.$image."); background-repeat:no-repeat; padding-left:20px;' value=\"".$image."\">".$image."</option>\n";
@ -20,7 +20,7 @@ class TipsTheme extends Themelet
<td><input name='enable' type='checkbox' value='Y' checked/></td>
</tr>
<tr>
<td>Image:</td>
<td>Post:</td>
<td>{$select}</td>
</tr>
<tr>
@ -60,7 +60,7 @@ class TipsTheme extends Themelet
"<thead><tr>".
"<th>ID</th>".
"<th>Enabled</th>".
"<th>Image</th>".
"<th>Post</th>".
"<th>Text</th>";
if ($user->can(Permissions::TIPS_ADMIN)) {