2020-01-26 13:19:35 +00:00
|
|
|
<?php declare(strict_types=1);
|
|
|
|
|
2019-05-28 17:59:38 +01:00
|
|
|
class BulkAddTest extends ShimmiePHPUnitTestCase
|
|
|
|
{
|
2020-01-28 21:19:59 +00:00
|
|
|
public function testInvalidDir() {
|
|
|
|
send_event(new UserLoginEvent(User::by_name($this->admin_name)));
|
|
|
|
$bae = send_event(new BulkAddEvent('asdf'));
|
2019-11-21 17:18:43 +00:00
|
|
|
$this->assertContains(
|
2019-05-28 17:59:38 +01:00
|
|
|
"Error, asdf is not a readable directory",
|
|
|
|
$bae->results,
|
|
|
|
implode("\n", $bae->results)
|
|
|
|
);
|
2020-01-28 21:19:59 +00:00
|
|
|
}
|
2019-05-28 17:59:38 +01:00
|
|
|
|
2020-01-28 21:19:59 +00:00
|
|
|
public function testValidDir() {
|
|
|
|
send_event(new UserLoginEvent(User::by_name($this->admin_name)));
|
2019-05-28 17:59:38 +01:00
|
|
|
send_event(new BulkAddEvent('tests'));
|
2020-01-28 21:19:59 +00:00
|
|
|
$page = $this->get_page("post/list/hash=17fc89f372ed3636e28bd25cc7f3bac1/1");
|
|
|
|
$this->assertEquals(302, $page->code);
|
2019-05-28 17:59:38 +01:00
|
|
|
}
|
2009-07-19 04:48:25 +01:00
|
|
|
}
|