2008-10-18 10:00:34 +00:00
|
|
|
<?php
|
2009-07-15 02:42:18 +01:00
|
|
|
class RSSImagesTest extends ShimmieWebTestCase {
|
2008-10-18 10:00:34 +00:00
|
|
|
function testImageFeed() {
|
2009-07-15 02:42:18 +01:00
|
|
|
$this->log_in_as_user();
|
|
|
|
$image_id = $this->post_image("ext/simpletest/data/pbx_screenshot.jpg", "pbx computer screenshot");
|
|
|
|
$this->log_out();
|
|
|
|
|
2012-03-09 22:08:55 +00:00
|
|
|
$this->get_page('rss/images');
|
2009-08-19 01:28:48 +01:00
|
|
|
$this->assert_mime("application/rss+xml");
|
|
|
|
$this->assert_no_text("Exception");
|
2008-10-18 11:43:44 +00:00
|
|
|
|
2012-03-09 22:08:55 +00:00
|
|
|
$this->get_page('rss/images/1');
|
2009-08-19 01:28:48 +01:00
|
|
|
$this->assert_mime("application/rss+xml");
|
|
|
|
$this->assert_no_text("Exception");
|
2008-10-18 11:43:44 +00:00
|
|
|
|
2009-07-16 20:20:53 +01:00
|
|
|
# FIXME: test that the image is actually found
|
2012-03-09 22:08:55 +00:00
|
|
|
$this->get_page('rss/images/computer/1');
|
2009-08-19 01:28:48 +01:00
|
|
|
$this->assert_mime("application/rss+xml");
|
|
|
|
$this->assert_no_text("Exception");
|
2009-07-16 20:20:53 +01:00
|
|
|
|
|
|
|
# valid tag, invalid page
|
2012-03-09 22:08:55 +00:00
|
|
|
$this->get_page('rss/images/computer/2');
|
2009-08-19 01:28:48 +01:00
|
|
|
$this->assert_mime("application/rss+xml");
|
|
|
|
$this->assert_no_text("Exception");
|
2008-10-18 11:43:44 +00:00
|
|
|
|
2009-07-16 20:20:53 +01:00
|
|
|
# not found
|
2012-03-09 22:08:55 +00:00
|
|
|
$this->get_page('rss/images/waffle/2');
|
2009-08-19 01:28:48 +01:00
|
|
|
$this->assert_mime("application/rss+xml");
|
|
|
|
$this->assert_no_text("Exception");
|
2009-07-15 02:42:18 +01:00
|
|
|
|
|
|
|
$this->log_in_as_admin();
|
|
|
|
$this->delete_image($image_id);
|
|
|
|
$this->log_out();
|
2008-10-18 10:00:34 +00:00
|
|
|
}
|
|
|
|
}
|
2014-04-25 22:54:51 -04:00
|
|
|
|