text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
<|fim_suffix|>em">{{ trans('settings.recycle_bin_permanently_delete') }}</a></li> </ul> </div> </div> </div><|fim_prefix|><div class="item-list-row flex-container-row items-center px-s wrap"> <div class="flex-2 px-m py-xs min-width-xl"> <div class="flex-container-row items-center py-...
fim
BookStackApp/BookStack
php
<|fim_suffix|> <div class="flex-container-row mb-s items-center"> @if($deletion->deletable->getParent() && $deletion->deletable->getParent()->trashed()) <div class="text-neg flex">{{ trans('settings.recycle_bin_restore_deleted_parent') }}</div> @endif ...
fim
BookStackApp/BookStack
php
@extends('layouts.simple') @section('body') <div class="container small"> @include('settings.parts.navbar', ['selected' => 'roles']) <div class="card content-wrap"> <h1 class="list-heading">{{ trans('settings.role_create') }}</h1> <form action="{{ url("/settings/roles/ne...
fim
BookStackApp/BookStack
php
<|fim_suffix|>ong>{{ trans('settings.role_delete_sure') }}</strong> </p> </div> <div> <div class="form-group text-right"> <a href="{{ url("/settings/roles/{$role->id}") }}" class="button outline">{{ trans...
fim
BookStackApp/BookStack
php
<|fim_suffix|>UsersManage) || user()->id == $user->id) <a href="{{ url("/settings/users/{$user->id}") }}"> @endif {{ $user->name }} @if(userCan(\BookStack\Permissio...
fim
BookStackApp/BookStack
php
<|fim_prefix|>@extends('layouts.simple') @section('body') <div class="container small"> @include('settings.parts.navbar', ['selected' => 'roles']) <div class="card content-wrap auto-height"> <div class="grid half v-center"> <h1 class="list-heading">{{ trans('settings...
fim
BookStackApp/BookStack
php
<|fim_prefix|><div class="item-list-row flex-container-row items-center wrap"> <div class="flex py-s px-m min-width-s"> <strong>{{ $title }}</strong> <br> <a href="#" refs="permissions-table@toggle-row" class="text-small text-link">{{ trans('common.toggle_all') }}</a> </div> <div class="flex...
fim
BookStackApp/BookStack
php
<|fim_suffix|>.$permission, false)|| (!old('display_name', false) && (isset($role) && $role->hasPermission($permission))), 'label' => $label ])<|fim_prefix|> @include('form.custom-checkbox', [ 'name' => 'permissions[' . $<|fim_middle|>permission . ']', 'value' => 'true', 'checked' => old('pe...
fim
BookStackApp/BookStack
php
<div class="setting-list"> <div class="grid half"> <div> <label class="setting-list-label">{{ trans('settings.role_details') }}</label> </div> <div> <div class="form-group"> <label for="display_name">{{ trans('settings.role_name') }}</label> ...
fim
BookStackApp/BookStack
php
<|fim_suffix|>ettings.roles.parts.checkbox', ['permission' => $permissionPrefix . '-delete-own', 'label' => trans('settings.role_own')]) <br> @include('settings.roles.parts.checkbox', ['permission' => $permissionPrefix . '-delete-all', 'label' => trans('settings.role_all')]) </div> </div><|fim_prefi...
fim
BookStackApp/BookStack
php
<|fim_suffix|>ttings.role_all')]) </div> <div class="flex py-s px-m min-width-xxs"> <small class="hide-over-m bold">{{ trans('common.edit') }}<br></small> <strong class="text-muted opacity-70 text-large">-</strong> </div> <div class="flex py-s px-m min-width-xxs"> <small class="h...
fim
BookStackApp/BookStack
php
<|fim_prefix|><div class="item-list-row flex-container-row py-xs items-center"> <div class="py-xs px-m flex-2"> <a href="{{ url("/settings/roles/{$role->id}") }}">{{ $role->display_name<|fim_suffix|>n('lock') </small> @endif <small>{{ $role->description }}</small> </div> <div class="...
fim
BookStackApp/BookStack
php
@extends('layouts.simple') @section('body') <div class="container small"> @include('settings.parts.navbar', ['selected' => 'settings']) <div class="card content-wrap auto-height"> <h1 class="list-heading">{{ trans('settings.sort_rule_create') }}</h1> <form action="{{ url...
fim
BookStackApp/BookStack
php
<|fim_suffix|>tems-center gap-l"> <div class="mb-m"> <h2 class="list-heading">{{ trans('settings.sort_rule_delete') }}</h2> <p class="text-muted mb-xs">{{ trans('settings.sort_rule_delete_desc') }}</p> @if($errors->has('delete')) ...
fim
BookStackApp/BookStack
php
<|fim_prefix|><div class="setting-list"> <div class="grid half"> <div> <label class="setting-list-label">{{ trans('settings.sort_rule_details') }}</label> <p class="text-muted text-<|fim_suffix|> <p class="text-muted text-small">{{ trans('settings.sort_rule_operations_desc') }}</p> ...
fim
BookStackApp/BookStack
php
<|fim_prefix|><li data-id="{{ $operation->value }}" class="scroll-box-item items-center"> <div class="handle px-s">@icon('grip')</div> <div class="text-small">{{ $operation->getLabel() }}</div> <div class="buttons flex-container-row items-center ml-auto px-xxs py-<|fim_suffix|>icon('chevron-down')</butt...
fim
BookStackApp/BookStack
php
<|fim_prefix|><div class="item-list-row flex-container-row py-xs px-m gap-m items-center"> <div class="py-xs flex"> <a href="{{ $rule->getUrl() }}">{{ $rule->name }}</a> </div> <div class="px-m text-small text-mu<|fim_suffix|>x fill-area min-width-xxs bold text-right text-book"><span class="opacity-...
fim
BookStackApp/BookStack
php
<|fim_prefix|>@extends('layouts.simple') @section('body') <div class="container small"> @include('settings.parts.navbar', ['selected' => 'webhooks']) <div class<|fim_suffix|>ommon.cancel') }}</a> <button type="submit" class="button">{{ trans('settings.webhooks_save') }}</butt...
fim
BookStackApp/BookStack
php
<|fim_prefix|>@extends('layouts.simple') @section('body') <div class="container small"> @include('settings.parts.navbar', ['selected' => 'webhooks']) <div class="card content-wrap auto-height"> <h1 class="list-heading"> {{ trans('settings.webhooks_delet<|fim_suffix|> ...
fim
BookStackApp/BookStack
php
<|fim_suffix|>tton outline">{{ trans('common.cancel') }}</a> <a href="{{ $webhook->getUrl('/delete') }}" class="button outline">{{ trans('settings.webhooks_delete') }}</a> <button type="submit" class="button">{{ trans('settings.webhooks_save') }}</button> </div> ...
fim
BookStackApp/BookStack
php
<|fim_prefix|>@extends('layouts.simple') @section('body') <div class="container small"> @include('settings.parts.navbar', ['selected' => 'webhooks']) <div class="card cont<|fim_suffix|>rtControlData()) </div> </div> @if(count($webhooks) > 0) ...
fim
BookStackApp/BookStack
php
<|fim_prefix|><div class="setting-list"> <div class="grid half"> <div> <label class="setting-list-label">{{ trans('settings.webhooks_details') }}</label> <p class="small">{{ trans('settings.webhooks_details_desc') }}</p> <div> @include('form.toggle-switch...
fim
BookStackApp/BookStack
php
<div component="code-highlighter" class="card content-wrap auto-height"> <h2 class="list-heading">{{ trans('settings.webhooks_format_example') }}</h2> <p>{{ trans('settings.webhooks_format_example_desc') }}</p> <pre><code class="language-json">{ "event": "page_update", "text": "Benny updated page \"...
fim
BookStackApp/BookStack
php
<|fim_suffix|>unt, ['count' => $webhook->tracked_events_count]) }} @endif </div> </div> <div class="px-m text-muted italic text-limit-lines-1"> <small>{{ $webhook->endpoint }}</small> </div> </div><|fim_prefix|><div class="item-list-row py-s"> <div class="flex-container-row"...
fim
BookStackApp/BookStack
php
<|fim_prefix|>@extends('layouts.simple') @section('body') <div class="container small"> <div class="my-s"> @include('entities.breadcrumb<|fim_suffix|>}</h1> <form action="{{ url("/shelves") }}" method="POST" enctype="multipart/form-data"> @include('shelves.parts.fo...
fim
BookStackApp/BookStack
php
<|fim_suffix|></p> <form action="{{ $shelf->getUrl() }}" method="POST" class="text-right"> {!! csrf_field() !!} <input type="hidden" name="_method" value="DELETE"> <a href="{{ $shelf->getUrl() }}" class="button outline">{{ trans('common.cance...
fim
BookStackApp/BookStack
php
<|fim_suffix|>{ trans('entities.shelves_edit') }}</h1> <form action="{{ $shelf->getUrl() }}" method="POST" enctype="multipart/form-data"> <input type="hidden" name="_method" value="PUT"> @include('shelves.parts.form', ['model' => $shelf]) </form> </main> ...
fim
BookStackApp/BookStack
php
<|fim_prefix|>@extends('layouts.tri') @section('body') @include('shelves.parts.list', ['shelves<|fim_suffix|>'popular' => $popular]) @include('shelves.parts.index-sidebar-section-new', ['new' => $new]) @stop<|fim_middle|>' => $shelves, 'view' => $view, 'listOptions' => $listOptions]) @stop @section('right') ...
fim
BookStackApp/BookStack
php
<|fim_suffix|> @endforeach </ul> </div> <div class="form-group"> <label for="books" id="shelf-sort-all-books-label">{{ trans('entities.shelves_add_books') }}</label> <input type="text" refs="shelf-sort@book-search" class="scroll-box-search" placeholder="{{ trans('commo...
fim
BookStackApp/BookStack
php
<|fim_prefix|><div id="actions" class="actions mb-xl"> <h5>{{ trans('common.actions') }}</h5> <div class="icon-list text-link"> @if(us<|fim_suffix|> <a href="{{ url('/tags') }}" class="icon-list-item"> <span>@icon('tag')</span> <span>{{ trans('entities.tags_view_tags') }}</span>...
fim
BookStackApp/BookStack
php
<|fim_suffix|>if </div><|fim_prefix|><div id="new" class="mb-xl"> <h5>{{ trans('entities.shelves_new') }}</h5> <|fim_middle|> @if(count($new) > 0) @include('entities.list', ['entities' => $new, 'style' => 'compact']) @else <p class="text-muted pb-l mb-none">{{ trans('entities.shelves_new_empt...
fim
BookStackApp/BookStack
php
<|fim_prefix|><div id="popular" class="mb-xl"> <h5>{{ trans('entities.shelves_popular') }}</h5> @if(count($popular) > 0) @include('entities.list', ['entities' => $popular, 'style' =<|fim_suffix|>dif </div><|fim_middle|>> 'compact']) @else <p class="text-muted pb-l mb-none">{{ trans('entities...
fim
BookStackApp/BookStack
php
<|fim_suffix|>act']) </div> @endif<|fim_prefix|>@if($recents) <div id="recents" class="mb-xl"> <h5>{{ trans('entities.recently_viewed') }}</h5> @include('entities.list', ['e<|fim_middle|>ntities' => $recents, 'style' => 'comp<|endoftext|>
fim
BookStackApp/BookStack
php
<|fim_suffix|>ass="entity-item-snippet"> <p class="text-muted break-text mb-none">{{ $shelf->getExcerpt() }}</p> </div> </div> </a> <div class="entity-shelf-books grid third gap-y-xs entity-list-item-children"> @foreach($shelf->visibleBooks as $book) <div> <a href="{{ $bo...
fim
BookStackApp/BookStack
php
<main class="content-wrap mt-m card"> <div class="grid half v-center"> <h1 class="list-heading">{{ trans('entities.shelves') }}</h1> <div class="text-right"> @include('common.sort', $listOptions->getSortControlData()) </div> </div> @if(count($shelves) > 0) @if($...
fim
BookStackApp/BookStack
php
<|fim_suffix|>ron-down')</button> <button type="button" data-action="remove" class="icon-button p-xxs" title="{{ trans('common.remove') }}">@icon('remove')</button> <button type="button" data-action="add" class="icon-button p-xxs" title="{{ trans('common.add') }}">@icon('...
fim
BookStackApp/BookStack
php
<|fim_prefix|><div id="actions" class="actions mb-xl"> <h5>{{ trans('common.actions') }}</h5> <div class="icon-list text-link"> @if(userCan(\BookStack\Permissions\Permission::BookCreateAll) && userCan(\BookStack\Permissions\Permission::BookshelfUpdate, $shelf)) <a href="{{ $shelf->getUrl('/...
fim
BookStackApp/BookStack
php
<|fim_suffix|>=> $activity]) </div> @endif<|fim_prefix|>@if(count($activity) > 0) <div id="recent-activity" class="mb-xl"> <h5>{{ trans('entities.recent_activity') }}</h5> @include('common.activity-list', ['acti<|fim_middle|>vity' <|endoftext|>
fim
BookStackApp/BookStack
php
<|fim_prefix|><div id="details" class="mb-xl"> <h5>{{ trans('common.details') }}</h5> <div class="blended-links"> @include('entities.meta', ['entity' => $shelf, 'watchOptions' => null]) <|fim_suffix|>> @icon('lock') <div>{{ trans('entities.shelves_p...
fim
BookStackApp/BookStack
php
@if($shelf->tags->count() > 0) <div id="tags" class="mb-xl"> @include('entities.tag-list', ['entity' => $shelf]) </div> @endif<|endoftext|>
fim
BookStackApp/BookStack
php
<|fim_prefix|>@extends('layouts.simple') @section('body') <div class="cont<|fim_suffix|>lex"> <h2 class="list-heading">{{ trans('entities.shelves_copy_permissions_to_books') }}</h2> <p>{{ trans('entities.shelves_copy_permissions_explain') }}</p> </div> <form...
fim
BookStackApp/BookStack
php
<|fim_suffix|>]]) </div> @include('entities.references', ['references' => $references]) </div> @stop <|fim_prefix|>@extends('layouts.simple') @section('body')<|fim_middle|> <div class="container small"> <div class="my-s"> @include('entities.breadcrumbs', ['crumbs' => [ ...
fim
BookStackApp/BookStack
php
<|fim_prefix|>@extends('layouts.tri') @push('social-meta') <meta property="og:description" content="{{ Str::limit($shelf->description, 100, '...') }}"> @if($shelf->coverInfo()->exists()) <meta property="og:image" content="{{ $shelf->coverInfo()->getUrl() }}"> @endif @endpush @include('entities.bod...
fim
BookStackApp/BookStack
php
<|fim_suffix|> </div> @else <p class="text-muted italic my-xl"> {{ trans('common.no_items') }}. <br> {{ trans('entities.tags_list_empty_hint') }} </p> @endif </main> </div> @stop <|fim_prefi...
fim
BookStackApp/BookStack
php
<|fim_suffix|>ag->page_count }}</a> <a href="{{ isset($tag->value) ? $tag->valueUrl() : $tag->nameUrl() . '+{type:chapter}' }}" title="{{ trans('entities.tags_assigned_chapters') }}" class="flex fill-area min-width-xxs bold text-right text-chapter"><span class="opacity-60">@icon('chapter')...
fim
BookStackApp/BookStack
php
<|fim_prefix|>@extends('users.account.layout') @section('main') @if($authMethod === 'standard') <section class="card content-wrap auto-height"> <form action="{{ url('/my-account/auth/password') }}" method="post"> {{ method_field('put') }} {{ csrf_field() }} ...
fim
BookStackApp/BookStack
php
<|fim_suffix|>references.delete_my_account_desc') }}</p> @if(userCan(\BookStack\Permissions\Permission::UsersManage)) <hr class="my-l"> <div class="grid half gap-xl v-center"> <div> <label class="setting-list-label">{{ trans('sett...
fim
BookStackApp/BookStack
php
<|fim_suffix|> @endif </nav> </div> </div> <div> @yield('main') </div> </div> </div> @stop<|fim_prefix|>@extends('layouts.simple') @section('body') <div class="container medium"> <d...
fim
BookStackApp/BookStack
php
<|fim_prefix|>@extends('users.account.layout') @section('main') <section class="card content-wrap auto-height"> <form action="{{ url('/my-account/notifications') }}" method="post"> {{ method_field('put') }} {{ csrf_field() }} <h1 class="list-heading">{{ trans('preferenc...
fim
BookStackApp/BookStack
php
<|fim_prefix|><div class="flex-container-row justify-space-between items-center gap-m item-list-row"> <label for="shortcut-{{ $id }}" class="bold flex px-m py-xs">{{ $label }}</label> <div class="<|fim_suffix|>-xs" id="shortcut-{{ $id }}" name="shortcut[{{ $id }}]" r...
fim
BookStackApp/BookStack
php
<|fim_suffix|> wrap"> <div class="flex"> <label class="setting-list-label" for="email">{{ trans('auth.email') }}</label> <p class="text-small mb-none">{{ trans('preferences.profile_email_desc') }}</p> </div> ...
fim
BookStackApp/BookStack
php
<|fim_prefix|>@extends('users.account.layout') @section('main') <section class="card content-wrap"> <form action="{{ url('/my-account/shortcuts') }}" method="post"> {{ method_field('put') }} {{ csrf_field() }} <|fim_suffix|> <div class="flex-container-row items-...
fim
BookStackApp/BookStack
php
<|fim_prefix|>@extends('layouts.simple') @section('body') <div class="container small pt-xl"> <main class="card content-wrap auto-height"<|fim_suffix|> <h1 class="list-heading">{{ trans('settings.user_api_token_create') }}</h1> <form action="{{ url('/api-tokens/' . $user->id . '/create')...
fim
BookStackApp/BookStack
php
<|fim_suffix|>/a> <button type="submit" class="button">{{ trans('common.confirm') }}</button> </form> </div> </div> </div> </div> @stop <|fim_prefix|>@extends('layouts.simple') @section('body') <div class="container small pt-xl"> ...
fim
BookStackApp/BookStack
php
<|fim_prefix|>@extends('layouts.simple') @section('body') <div class="container small pt-xl"> <main class="card content-wrap auto-height"> <h1 class="list-heading">{{ trans('settings.user_api_token') }}</h1> <form action="{{ $token->getUr<|fim_suffix|>ext-warn">{{ trans('settings...
fim
BookStackApp/BookStack
php
<div class="grid half gap-xl v-center"> <div> <label class="setting-list-label">{{ trans('settings.user_api_token_name') }}</label> <p class="small">{{ trans('settings.user_api_token_name_desc') }}</p> </div> <div> @include('form.text', ['name' => 'name']) </div> </div> <div c...
fim
BookStackApp/BookStack
php
<|fim_prefix|><section class="card content-wrap auto-height" id="api_tokens"> <div class="flex-container-row wrap justify-space-between items-center mb-s"> <h2 class="list-heading">{{ trans<|fim_suffix|>alic py-m">{{ trans('settings.users_api_tokens_none') }}</p> @endif </section><|fim_middle|>('setting...
fim
BookStackApp/BookStack
php
<|fim_suffix|>/main> </div> @stop <|fim_prefix|>@extends('layouts.simple') @section('body') <div class="container small"> @include('settings.parts.navbar', ['selected' => 'users']) <main class="card content-wrap"> <h1 class="list-heading">{{ trans('settings.users_add_new') }}</h...
fim
BookStackApp/BookStack
php
<|fim_suffix|> </div> <hr class="my-l"> <div class="grid half"> <p class="text-neg"><strong>{{ trans('settings.users_delete_confirm') }}</strong></p> <div class="text-right"> <a href="{{ url("/settings/users/...
fim
BookStackApp/BookStack
php
<|fim_prefix|>@extends('layouts.simple') @section('body') <div class="container small"> <|fim_suffix|>up') }}" class="button outline">{{ trans('settings.users_mfa_configure') }}</a> @endif </div> </div> @if($mfaMethods->coun...
fim
BookStackApp/BookStack
php
<|fim_prefix|>@extends('layouts.simple') @section('body') <div class="container small"> @include('settings.parts.navbar', ['selected' => 'users']) <main class="card content-wrap"> <div class="flex-container-row wrap justify-space-between items-center"> <h1 class="list...
fim
BookStackApp/BookStack
php
<|fim_suffix|>tandard') <div component="new-user-password"> <label class="setting-list-label">{{ trans('settings.users_password') }}</label> @if(!isset($model)) <p class="small"> {{ trans('settings.users_send_invite_text') }} </p> @include('form....
fim
BookStackApp/BookStack
php
<|fim_suffix|> @endforeach </select> </div> </div><|fim_prefix|>{{-- $value - Currently selected lanuage value --}} <div class="grid half gap-xl v-center"> <div> <label for="user-language" class="setting-list-label">{{ trans('settings.users_preferred_language') }}</label> <p class="...
fim
BookStackApp/BookStack
php
<|fim_suffix|>users/{$user->id}") }}"> {{ $user->name }} <br> <span class="text-muted">{{ $user->email }}</span> @if($user->mfa_values_count > 0) <span title="MFA Configured" class="text-pos">@icon('lock')</span> @endif </a> </div> ...
fim
BookStackApp/BookStack
php
@extends('layouts.simple') @section('body') <div class="container medium pt-xl"> <div class="grid right-focus reverse-collapse"> <div> <section id="recent-user-activity" class="mb-xl"> <h5>{{ trans('entities.recent_activity') }}</h5> @i...
fim
BookStackApp/BookStack
php
<|fim_prefix|><?php /** * Routes for the BookStack API. * Routes have a URI prefix of /api/. * Controllers all end with "ApiController" */ use BookStack\Activity\Controllers as ActivityControllers; use BookStack\Activity\Controllers\TagApiController; use BookStack\Api\ApiDocsController; use BookStack\App\SystemAp...
fim
BookStackApp/BookStack
php
<|fim_suffix|>ers\WebhookController::class, 'delete']); Route::delete('/settings/webhooks/{id}', [ActivityControllers\WebhookController::class, 'destroy']); // Sort Rules Route::get('/settings/sorting/rules/new', [SortingControllers\SortRuleController::class, 'create']); Route::post('/settings/sorting/...
fim
BookStackApp/BookStack
php
<|fim_prefix|><?php namespace Tests\Activity; use BookStack\Activity\ActivityType; use BookStack\Facades\Activity; use Tests\Api\TestsApi; use Tests\TestCase; class AuditLogApiTest extends TestCase { use TestsApi; public function test_user_and_settin<|fim_suffix|> 'id' => $admin->id, 'n...
fim
BookStackApp/BookStack
php
<|fim_suffix|> $editor = $this->users->editor(); $page = $this->entities->page(); $this->actingAs($editor)->put($page->getUrl(), [ 'name' => 'Updated page', 'html' => '<p>Updated content</p>', ], [ 'X-Forwarded-For' => '192.123.45.1', 'REMOTE_ADD...
fim
BookStackApp/BookStack
php
<|fim_suffix|>['commentable_id' => $page->id, 'commentable_type' => $page->getMorphClass()]); $comment->created_at = now()->subWeek(); $comment->updated_at = now()->subDay(); $comment->save(); $pageResp = $this->asAdmin()->get($page->getUrl()); $html = $this->withHtml($pageResp)...
fim
BookStackApp/BookStack
php
<|fim_suffix|>/{$page->id}", [ 'html' => '<p>Hello <a data-mention-user-id="' . $editor->id . '"></a> and <a data-mention-user-id="' . $otherUser->id . '"></a></p>' ])->assertOk(); $notifications->assertNothingSent(); $comment = $page->comments()->latest()->first(); $this->...
fim
BookStackApp/BookStack
php
<|fim_prefix|><?php namespace Tests\Activity; use Tests\TestCase; class CommentSettingTest extends TestCase { public func<|fim_suffix|>is->setSettings(['app-disable-comments' => 'true']); $this->asAdmin(); $resp = $this->asAdmin()->get($page->getUrl()); $this->withHtml($resp)->assertElem...
fim
BookStackApp/BookStack
php
<|fim_suffix|>donclick', false); } public function test_comment_html_is_limited() { $page = $this->entities->page(); $input = '<h1>Test</h1><p id="abc" href="beans">Content<a href="#cat" data-a="b">a</a><section>Hello</section><section>there</section></p>'; $expected = '<p>Content<a...
fim
BookStackApp/BookStack
php
<?php namespace Tests\Activity; use BookStack\Activity\Models\Comment; use BookStack\Permissions\Permission; use Tests\Api\TestsApi; use Tests\TestCase; class CommentsApiTest extends TestCase { use TestsApi; public function test_endpoint_permission_controls() { $user = $this->users->editor(); ...
fim
BookStackApp/BookStack
php
<|fim_prefix|><?php namespace Tests\Activity; use BookStack\Activity\Tools\MentionParser; use Tests\TestCase; class MentionParserTest extends TestCase { public function test_it_extracts_mentions() { $parser = new MentionParser(); // Test basic mention extraction $html = '<p>Hello <a ...
fim
BookStackApp/BookStack
php
<|fim_prefix|><?php namespace Tests\Activity; use BookStack\Activity\ActivityType; use BookStack\Activity\Models\Comment; use BookStack\Activity\Notifications\Messages\BaseActivityNotification; use BookStack\Activity\Notifications\Messages\CommentCreationNotification; use BookStack\Activity\Notifications\Messages\Pag...
fim
BookStackApp/BookStack
php
<|fim_prefix|><?php namespace Tests\Activity; use BookStack\Activity\ActivityType; use BookStack\Activity\DispatchWebhookJob; use BookStack\Activity\Models\Webhook; use BookStack\Activity\Tools\ActivityLogger; use BookStack\Api\ApiToken; use BookStack\Users\Models\User; use GuzzleHttp\Exception\ConnectException; use ...
fim
BookStackApp/BookStack
php
<|fim_prefix|><?php namespace Tests\Activity; use BookStack\Activity\ActivityType; use BookStack\Activity\Models\Webhook; use BookStack\Activity\Tools\WebhookFormatter; use Illuminate\Support\Arr; use Tests\TestCase; class WebhookFormatTesting extends TestCase { public function test_entity_events_show_related_us...
fim
BookStackApp/BookStack
php
<|fim_suffix|>tive' => true, 'timeout' => 5, ]); $trackedEvents = $webhook->trackedEvents()->get(); $this->assertCount(2, $trackedEvents); $this->assertEquals(['page_create', 'page_update'], $trackedEvents->pluck('event')->values()->all()); $this->assertActivityE...
fim
BookStackApp/BookStack
php
<|fim_prefix|><?php namespace Tests\Api; use BookStack\Permissions\Models\RolePermission; use BookStack\Users\Models\Role; use BookStack\Users\Models\User; use Carbon\Carbon; use Tests\TestCase; class ApiAuthTest extends TestCase { use TestsApi; protected string $endpoint = '/api/books'; public functio...
fim
BookStackApp/BookStack
php
<|fim_suffix|> $resp = $this->get($this->endpoint); $resp->assertJsonCount(1, 'data'); } public function test_default_item_count_does_not_limit_count_param() { $this->actingAsApiEditor(); config()->set(['api.default_item_count' => 1]); $resp = $this->get($this->endpoint ....
fim
BookStackApp/BookStack
php
<|fim_suffix|>'uri' => 'api/docs', ]], ]); } } <|fim_prefix|><?php namespace Tests\Api; use Tests\TestCase; class ApiDocsTest extends TestCase { use TestsApi; protected string $endpoint = '/api/docs'; public function test_api_endpoint_redirects_to_docs() { $resp = $...
fim
BookStackApp/BookStack
php
<?php namespace Tests\Api; use BookStack\Entities\Models\Book; use Tests\TestCase; class ApiListingTest extends TestCase { use TestsApi; protected $endpoint = '/api/books'; public function test_count_parameter_limits_responses() { $this->actingAsApiEditor(); $bookCount = min(Book::v...
fim
BookStackApp/BookStack
php
<|fim_suffix|>localhost/attachments/{$attachment->id}\">My file attachment</a>", 'markdown' => "[My file attachment](http://localhost/attachments/{$attachment->id})", ], ]); unlink(storage_path($attachment->path)); } public function test_attachment_not_visible_on_ot...
fim
BookStackApp/BookStack
php
<|fim_suffix|>ook->refresh(); $this->assertGreaterThan(Carbon::now()->subDay()->unix(), $book->updated_at->unix()); } public function test_update_cover_image_control() { $this->actingAsApiEditor(); /** @var Book $book */ $book = $this->entities->book(); $this->assert...
fim
BookStackApp/BookStack
php
<|fim_prefix|><?php namespace Tests\Api; use BookStack\Entities\Models\Book; use BookStack\Entities\Models\Chapter; use Carbon\Carbon; use Illuminate\Support\Facades\DB; use Tests\TestCase; class ChaptersApiTest extends TestCase { use TestsApi; protected string $baseEndpoint = '/api/chapters'; public f...
fim
BookStackApp/BookStack
php
<|fim_prefix|><?php namespace Tests\Api; use Tests\TestCase; class ContentPermissionsApiTest extends TestCase { use TestsApi; protected string $baseEndpoint = '/api/content-permissions'; public function test_user_roles_manage_permission_needed_for_all_endpoints() { $page = $this->entities->...
fim
BookStackApp/BookStack
php
<|fim_prefix|><?php namespace Tests\Api; use BookStack\Entities\Models\Book; use BookStack\Entities\Models\Chapter; use Tests\Exports\ZipTestHelper; use Tests\TestCase; class ExportsApiTest extends TestCase { use TestsApi; public function test_book_html_endpoint() { $this->actingAsApiEditor(); ...
fim
BookStackApp/BookStack
php
<|fim_prefix|><?php namespace Tests\Api; use BookStack\Entities\Models\Page; use BookStack\Uploads\Image; use Tests\TestCase; class ImageGalleryApiTest extends TestCase { use TestsApi; protected string $baseEndpoint = '/api/image-gallery'; public function test_index_endpoint_returns_expected_image_and_...
fim
BookStackApp/BookStack
php
<|fim_suffix|>age' => [ 'tags' => [ [ 'name' => 'My api tag', 'value' => 'api test value' ] ], ], ]); $resp = $this->actingAsApiAdmin()->call('POST', $this->baseEndpoint, ...
fim
BookStackApp/BookStack
php
<|fim_prefix|><?php namespace Tests\Api; use BookStack\Activity\Models\Comment; use BookStack\Entities\Models\Chapter; use BookStack\Entities\Models\Page; use Carbon\Carbon; use Illuminate\Support\Facades\DB; use Tests\TestCase; class PagesApiTest extends TestCase { use TestsApi; protected string $baseEndpo...
fim
BookStackApp/BookStack
php
<|fim_suffix|>ages_count' => $book->pages_count, 'chapters_count' => $book->chapters_count, ], ], ]; $resp->assertJson([ 'data' => $expectedData, 'total' => 1, ]); } public function test_index_endpoint_returns_...
fim
BookStackApp/BookStack
php
<|fim_prefix|><?php namespace Tests\Api; use BookStack\Activity\ActivityType; use BookStack\Users\Models\Role; use BookStack\Users\Models\User; use Tests\TestCase; class RolesApiTest extends TestCase { use TestsApi; protected string $ba<|fim_suffix|>deleting_default_registration_role() { $this->...
fim
BookStackApp/BookStack
php
<|fim_prefix|><?php namespace Tests\Api; use BookStack\Entities\Models\Book; use BookStack\Entities\Models\Bookshelf; use BookStack\Entities\Models\Chapter; use BookStack\Entities\Models\Entity; use BookStack\Entities\Models\Page; use Tests\TestCase; class SearchApiTest extends TestCase { use TestsApi; prot...
fim
BookStackApp/BookStack
php
<|fim_prefix|><?php namespace Tests\Api; use BookStack\Entities\Models\Book; use BookStack\Entities\Models\Bookshelf; use BookStack\Entities\Repos\BaseRepo; use Carbon\Carbon; use Illuminate\Support\Facades\DB; use Tests\TestCase; class ShelvesApiTest extends TestCase { use TestsApi; protected string $baseE...
fim
BookStackApp/BookStack
php
<|fim_suffix|>this->assertEquals(url('/logo.png'), $data['app_logo']); $this->assertEquals(url('/'), $data['base_url']); } } <|fim_prefix|><?php namespace Tests\Api; use Tests\Test<|fim_middle|>Case; class SystemApiTest extends TestCase { use TestsApi; public function test_read_returns_app_info(...
fim
BookStackApp/BookStack
php
<|fim_prefix|><?php namespace Tests\Api; use BookStack\Activity\Models\Tag; use BookStack\Entities\Models\Book; use BookStack\Entities\Models\Chapter; use BookStack\Entities\Models\Page; use Tests\TestCase; class TagsApiTest extends TestCase { use TestsApi; public function test_list_names_provides_rolled_up...
fim
BookStackApp/BookStack
php
<|fim_prefix|><?php namespace Tests\Api; use BookStack\Users\Models\User; trait TestsApi { protected string $apiTokenId = 'apitoken'; protected string $apiTokenSecret = 'password'; /** * Set the given user as the current logged-in user via the API driver. * This does not ensure API access. The...
fim
BookStackApp/BookStack
php
<|fim_prefix|><?php namespace Tests\Api; use BookStack\Access\Notifications\UserInviteNotification; use BookStack\Activity\ActivityType; use BookStack\Activity\Models\Activity as ActivityModel; use BookStack\Entities\Models\Entity; use BookStack\Facades\Activity; use BookStack\Users\Models\Role; use BookStack\Users\M...
fim
BookStackApp/BookStack
php
<|fim_suffix|>ogins_are_logged_when_message_configured() { $log = $this->withTestLogger(); config()->set(['logging.failed_login.message' => 'Failed login for %u']); $this->post('/login', ['email' => 'admin@example.com', 'password' => 'cattreedog']); $this->assertTrue($log->hasWarnin...
fim
BookStackApp/BookStack
php