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
2024-01-15 14:31:51 +00:00

23 lines
668 B
PHP

<?php
declare(strict_types=1);
namespace Shimmie2;
class BulkAddTest extends ShimmiePHPUnitTestCase
{
public function testInvalidDir(): void
{
send_event(new UserLoginEvent(User::by_name(self::$admin_name)));
$bae = send_event(new BulkAddEvent('asdf'));
$this->assertTrue(is_a($bae->results[0], UploadError::class));
}
public function testValidDir(): void
{
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);
}
}