mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
078e8e7dc3
- Updated PhpStan PHP version option to match project. - Applied StyleCI changes. - Updated static to self in WebhookFormatter, following static analysis guidance. - Fixed mis-matched header tags.
40 lines
1.0 KiB
PHP
40 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace Tests\Settings;
|
|
|
|
use Tests\TestCase;
|
|
|
|
class SettingsTest extends TestCase
|
|
{
|
|
public function test_settings_endpoint_redirects_to_settings_view()
|
|
{
|
|
$resp = $this->asAdmin()->get('/settings');
|
|
|
|
$resp->assertRedirect('/settings/features');
|
|
}
|
|
|
|
public function test_settings_category_links_work_as_expected()
|
|
{
|
|
$this->asAdmin();
|
|
$categories = [
|
|
'features' => 'Features & Security',
|
|
'customization' => 'Customization',
|
|
'registration' => 'Registration',
|
|
];
|
|
|
|
foreach ($categories as $category => $title) {
|
|
$resp = $this->get("/settings/{$category}");
|
|
$resp->assertElementContains('h1', $title);
|
|
$resp->assertElementExists("form[action$=\"/settings/{$category}\"]");
|
|
}
|
|
}
|
|
|
|
public function test_not_found_setting_category_throws_404()
|
|
{
|
|
$resp = $this->asAdmin()->get('/settings/biscuits');
|
|
|
|
$resp->assertStatus(404);
|
|
$resp->assertSee('Page Not Found');
|
|
}
|
|
}
|