mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-03-25 07:55:11 +08:00
Settings: Added test to cover setting category by view
Some checks failed
analyse-php / build (push) Has been cancelled
lint-php / build (push) Has been cancelled
test-migrations / build (8.1) (push) Has been cancelled
test-migrations / build (8.2) (push) Has been cancelled
test-migrations / build (8.3) (push) Has been cancelled
test-php / build (8.1) (push) Has been cancelled
test-php / build (8.2) (push) Has been cancelled
test-php / build (8.3) (push) Has been cancelled
Some checks failed
analyse-php / build (push) Has been cancelled
lint-php / build (push) Has been cancelled
test-migrations / build (8.1) (push) Has been cancelled
test-migrations / build (8.2) (push) Has been cancelled
test-migrations / build (8.3) (push) Has been cancelled
test-php / build (8.1) (push) Has been cancelled
test-php / build (8.2) (push) Has been cancelled
test-php / build (8.3) (push) Has been cancelled
This commit is contained in:
parent
a3d0f7478f
commit
4dc75bad05
@ -58,7 +58,7 @@ class SettingController extends Controller
|
||||
protected function ensureCategoryExists(string $category): void
|
||||
{
|
||||
if (!view()->exists('settings.categories.' . $category)) {
|
||||
abort(404, 'Category not found');
|
||||
abort(404);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -451,6 +451,19 @@ END;
|
||||
});
|
||||
}
|
||||
|
||||
public function test_custom_settings_category_page_can_be_added_via_view_file()
|
||||
{
|
||||
$content = 'My SuperCustomSettings';
|
||||
|
||||
$this->usingThemeFolder(function (string $folder) use ($content) {
|
||||
$viewDir = theme_path('settings/categories');
|
||||
mkdir($viewDir, 0777, true);
|
||||
file_put_contents($viewDir . '/beans.blade.php', $content);
|
||||
|
||||
$this->asAdmin()->get('/settings/beans')->assertSee($content);
|
||||
});
|
||||
}
|
||||
|
||||
protected function usingThemeFolder(callable $callback)
|
||||
{
|
||||
// Create a folder and configure a theme
|
||||
|
Loading…
x
Reference in New Issue
Block a user