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

26 lines
735 B
PHP
Raw Normal View History

2021-12-14 18:32:47 +00:00
<?php
declare(strict_types=1);
2020-01-26 13:19:35 +00:00
class BulkAddTest extends ShimmiePHPUnitTestCase
{
2020-01-29 00:49:21 +00:00
public function testInvalidDir()
{
2020-01-29 20:22:50 +00:00
send_event(new UserLoginEvent(User::by_name(self::$admin_name)));
$bae = send_event(new BulkAddEvent('asdf'));
2020-10-29 01:28:46 +00:00
$this->assertContainsEquals(
"Error, asdf is not a readable directory",
$bae->results,
implode("\n", $bae->results)
);
}
2020-01-29 00:49:21 +00:00
public function testValidDir()
{
2020-01-29 20:22:50 +00:00
send_event(new UserLoginEvent(User::by_name(self::$admin_name)));
send_event(new BulkAddEvent('tests'));
$page = $this->get_page("post/list/hash=17fc89f372ed3636e28bd25cc7f3bac1/1");
$this->assertEquals(302, $page->code);
}
2009-07-19 03:48:25 +00:00
}