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

57 lines
1.5 KiB
PHP
Raw Normal View History

2021-12-14 18:32:47 +00:00
<?php
declare(strict_types=1);
namespace Shimmie2;
class SetupTest extends ShimmiePHPUnitTestCase
{
2024-01-15 14:31:51 +00:00
public function testNiceUrlsTest(): void
{
# XXX: this only checks that the text is "ok", to check
# for a bug where it was coming out as "\nok"; it doesn't
# check that niceurls actually work
$this->get_page('nicetest');
$this->assert_content("ok");
$this->assert_no_content("\n");
}
2009-10-09 11:27:13 +00:00
2024-02-11 23:28:48 +00:00
public function testNiceDebug(): void
{
// the automatic testing for shimmie2-examples depends on this
$page = $this->get_page('nicedebug/foo%2Fbar/1');
$this->assertEquals('{"args":["nicedebug","foo%2Fbar","1"]}', $page->data);
}
2024-01-15 14:31:51 +00:00
public function testAuthAnon(): void
{
2024-02-11 15:47:40 +00:00
$this->assertException(PermissionDenied::class, function () {
$this->get_page('setup');
});
}
2015-09-20 19:44:34 +00:00
2024-01-15 14:31:51 +00:00
public function testAuthUser(): void
{
$this->log_in_as_user();
2024-02-11 15:47:40 +00:00
$this->assertException(PermissionDenied::class, function () {
$this->get_page('setup');
});
}
2024-01-15 14:31:51 +00:00
public function testAuthAdmin(): void
{
$this->log_in_as_admin();
$this->get_page('setup');
$this->assert_title("Shimmie Setup");
$this->assert_text("General");
}
2009-09-27 14:48:38 +00:00
2024-01-15 14:31:51 +00:00
public function testAdvanced(): void
{
$this->log_in_as_admin();
$this->get_page('setup/advanced');
$this->assert_title("Shimmie Setup");
$this->assert_text(ImageConfig::THUMB_QUALITY);
}
}