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

38 lines
1.1 KiB
PHP
Raw Normal View History

2009-07-19 03:48:25 +00:00
<?php
2015-08-23 15:09:52 +00:00
class BulkAddTest extends ShimmiePHPUnitTestCase {
2015-09-26 10:17:13 +00:00
public function testBulkAdd() {
2009-07-19 03:48:25 +00:00
$this->log_in_as_admin();
2012-03-09 22:08:55 +00:00
$this->get_page('admin');
2009-09-19 22:03:47 +00:00
$this->assert_title("Admin Tools");
2015-08-23 15:09:52 +00:00
$bae = new BulkAddEvent('asdf');
send_event($bae);
$this->assertContains("Error, asdf is not a readable directory",
$bae->results, implode("\n", $bae->results));
// FIXME: have BAE return a list of successes as well as errors?
$this->markTestIncomplete();
2009-09-19 22:03:47 +00:00
2012-03-09 22:08:55 +00:00
$this->get_page('admin');
2009-08-19 00:28:48 +00:00
$this->assert_title("Admin Tools");
2015-08-23 15:09:52 +00:00
send_event(new BulkAddEvent('tests'));
2009-07-19 16:39:07 +00:00
2009-07-20 05:51:36 +00:00
# FIXME: test that the output here makes sense, no "adding foo.php ... ok"
2009-07-19 16:39:07 +00:00
$this->get_page("post/list/hash=17fc89f372ed3636e28bd25cc7f3bac1/1");
2009-08-19 00:28:48 +00:00
$this->assert_title(new PatternExpectation("/^Image \d+: data/"));
2009-07-19 16:39:07 +00:00
$this->click("Delete");
$this->get_page("post/list/hash=feb01bab5698a11dd87416724c7a89e3/1");
2009-08-19 00:28:48 +00:00
$this->assert_title(new PatternExpectation("/^Image \d+: data/"));
2009-07-19 16:39:07 +00:00
$this->click("Delete");
2009-07-19 03:48:25 +00:00
2012-03-09 21:34:03 +00:00
$this->get_page("post/list/hash=e106ea2983e1b77f11e00c0c54e53805/1");
$this->assert_title(new PatternExpectation("/^Image \d+: data/"));
$this->click("Delete");
2009-07-19 03:48:25 +00:00
$this->log_out();
}
}