mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-04-12 16:08:08 +00:00
Applied styleci style changes
This commit is contained in:
parent
6454e24657
commit
c08c8d7aa3
10 changed files with 51 additions and 55 deletions
tests
|
@ -244,7 +244,7 @@ class AuthTest extends TestCase
|
|||
'email' => 'admin@admin.com',
|
||||
'password' => 'randompass',
|
||||
'password_confirmation' => 'randompass',
|
||||
'token' => $n->first()->token
|
||||
'token' => $n->first()->token,
|
||||
]);
|
||||
$resp->assertRedirect('/');
|
||||
|
||||
|
@ -260,13 +260,12 @@ class AuthTest extends TestCase
|
|||
$resp->assertSee('A password reset link will be sent to barry@admin.com if that email address is found in the system.');
|
||||
$resp->assertDontSee('We can\'t find a user');
|
||||
|
||||
|
||||
$this->get('/password/reset/arandometokenvalue')->assertSee('Reset Password');
|
||||
$resp = $this->post('/password/reset', [
|
||||
'email' => 'barry@admin.com',
|
||||
'password' => 'randompass',
|
||||
'password_confirmation' => 'randompass',
|
||||
'token' => 'arandometokenvalue'
|
||||
'token' => 'arandometokenvalue',
|
||||
]);
|
||||
$resp->assertRedirect('/password/reset/arandometokenvalue');
|
||||
|
||||
|
|
|
@ -227,7 +227,7 @@ class PageTest extends TestCase
|
|||
// Need to save twice since revisions are not generated in seeder.
|
||||
$this->asAdmin()->put($page->getUrl(), [
|
||||
'name' => 'super test',
|
||||
'html' => '<p></p>'
|
||||
'html' => '<p></p>',
|
||||
]);
|
||||
|
||||
$page->refresh();
|
||||
|
@ -235,7 +235,7 @@ class PageTest extends TestCase
|
|||
|
||||
$this->put($pageUrl, [
|
||||
'name' => 'super test page',
|
||||
'html' => '<p></p>'
|
||||
'html' => '<p></p>',
|
||||
]);
|
||||
|
||||
$this->get($pageUrl)
|
||||
|
@ -280,5 +280,4 @@ class PageTest extends TestCase
|
|||
$this->get('/')
|
||||
->assertElementContains('#recently-updated-pages', $page->name);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -167,7 +167,6 @@ class EntityPermissionsTest extends TestCase
|
|||
]);
|
||||
$resp->assertRedirect($book->getUrl('/chapter/test-chapter'));
|
||||
|
||||
|
||||
$this->get($book->getUrl('/create-page'));
|
||||
/** @var Page $page */
|
||||
$page = Page::query()->where('draft', '=', true)->orderBy('id', 'desc')->first();
|
||||
|
@ -404,8 +403,8 @@ class EntityPermissionsTest extends TestCase
|
|||
'restricted' => 'true',
|
||||
'restrictions' => [
|
||||
$roleId => [
|
||||
$permission => 'true'
|
||||
]
|
||||
$permission => 'true',
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
|
@ -561,7 +560,6 @@ class EntityPermissionsTest extends TestCase
|
|||
]);
|
||||
$resp->assertRedirect($book->getUrl('/chapter/test-chapter'));
|
||||
|
||||
|
||||
$this->get($book->getUrl('/create-page'));
|
||||
/** @var Page $page */
|
||||
$page = Page::query()->where('draft', '=', true)->orderByDesc('id')->first();
|
||||
|
@ -730,7 +728,6 @@ class EntityPermissionsTest extends TestCase
|
|||
|
||||
$this->setRestrictionsForTestRoles($bookChapter, ['view', 'create']);
|
||||
|
||||
|
||||
$this->get($bookChapter->getUrl('/create-page'));
|
||||
/** @var Page $page */
|
||||
$page = Page::query()->where('draft', '=', true)->orderByDesc('id')->first();
|
||||
|
|
|
@ -927,12 +927,14 @@ class RolesTest extends TestCase
|
|||
private function addComment(Page $page): TestResponse
|
||||
{
|
||||
$comment = factory(Comment::class)->make();
|
||||
|
||||
return $this->postJson("/comment/$page->id", $comment->only('text', 'html'));
|
||||
}
|
||||
|
||||
private function updateComment(Comment $comment): TestResponse
|
||||
{
|
||||
$commentData = factory(Comment::class)->make();
|
||||
|
||||
return $this->putJson("/comment/{$comment->id}", $commentData->only('text', 'html'));
|
||||
}
|
||||
|
||||
|
|
|
@ -213,6 +213,7 @@ trait SharedTestHelpers
|
|||
|
||||
/**
|
||||
* Create a group of entities that belong to a specific user.
|
||||
*
|
||||
* @return array{book: Book, chapter: Chapter, page: Page}
|
||||
*/
|
||||
protected function createEntityChainBelongingToUser(User $creatorUser, ?User $updaterUser = null): array
|
||||
|
|
|
@ -12,7 +12,6 @@ use Tests\TestCase;
|
|||
|
||||
class UserManagementTest extends TestCase
|
||||
{
|
||||
|
||||
public function test_user_creation()
|
||||
{
|
||||
/** @var User $user */
|
||||
|
@ -48,12 +47,11 @@ class UserManagementTest extends TestCase
|
|||
$user = $this->getNormalUser();
|
||||
$password = $user->password;
|
||||
|
||||
|
||||
$resp = $this->asAdmin()->get('/settings/users/' . $user->id);
|
||||
$resp->assertSee($user->email);
|
||||
|
||||
$this->put($user->getEditUrl(), [
|
||||
'name' => 'Barry Scott'
|
||||
'name' => 'Barry Scott',
|
||||
])->assertRedirect('/settings/users');
|
||||
|
||||
$this->assertDatabaseHas('users', ['id' => $user->id, 'name' => 'Barry Scott', 'password' => $password]);
|
||||
|
@ -70,7 +68,7 @@ class UserManagementTest extends TestCase
|
|||
|
||||
$this->asAdmin()->get($userProfilePage);
|
||||
$this->put($userProfilePage, [
|
||||
'password' => 'newpassword'
|
||||
'password' => 'newpassword',
|
||||
])->assertRedirect($userProfilePage);
|
||||
|
||||
$this->get($userProfilePage)->assertSee('Password confirmation required');
|
||||
|
|
Loading…
Add table
Reference in a new issue