mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
Applied latest styleci changes
This commit is contained in:
parent
72c8b138e1
commit
840a1ea011
@ -25,7 +25,7 @@ class IpFormatter
|
|||||||
protected function maskIpv4(): string
|
protected function maskIpv4(): string
|
||||||
{
|
{
|
||||||
$exploded = $this->explodeAndExpandIp('.', 4);
|
$exploded = $this->explodeAndExpandIp('.', 4);
|
||||||
$maskGroupCount = min( 4 - $this->precision, count($exploded));
|
$maskGroupCount = min(4 - $this->precision, count($exploded));
|
||||||
|
|
||||||
for ($i = 0; $i < $maskGroupCount; $i++) {
|
for ($i = 0; $i < $maskGroupCount; $i++) {
|
||||||
$exploded[3 - $i] = 'x';
|
$exploded[3 - $i] = 'x';
|
||||||
|
@ -76,7 +76,7 @@ class FavouriteTest extends TestCase
|
|||||||
public function test_header_contains_link_to_favourites_page_when_logged_in()
|
public function test_header_contains_link_to_favourites_page_when_logged_in()
|
||||||
{
|
{
|
||||||
$this->setSettings(['app-public' => 'true']);
|
$this->setSettings(['app-public' => 'true']);
|
||||||
$resp = $this->get('/');
|
$resp = $this->get('/');
|
||||||
$this->withHtml($resp)->assertElementNotContains('header', 'My Favourites');
|
$this->withHtml($resp)->assertElementNotContains('header', 'My Favourites');
|
||||||
$resp = $this->actingAs($this->getViewer())->get('/');
|
$resp = $this->actingAs($this->getViewer())->get('/');
|
||||||
$this->withHtml($resp)->assertElementContains('header a', 'My Favourites');
|
$this->withHtml($resp)->assertElementContains('header a', 'My Favourites');
|
||||||
|
@ -543,7 +543,7 @@ class EntityPermissionsTest extends TestCase
|
|||||||
$this->get('/')->assertSee('You do not have permission');
|
$this->get('/')->assertSee('You do not have permission');
|
||||||
$this->get($bookUrl . '/create-page')->assertRedirect('/');
|
$this->get($bookUrl . '/create-page')->assertRedirect('/');
|
||||||
$this->get('/')->assertSee('You do not have permission');
|
$this->get('/')->assertSee('You do not have permission');
|
||||||
$resp = $this->get($bookUrl);
|
$resp = $this->get($bookUrl);
|
||||||
$this->withHtml($resp)->assertElementNotContains('.actions', 'New Page')
|
$this->withHtml($resp)->assertElementNotContains('.actions', 'New Page')
|
||||||
->assertElementNotContains('.actions', 'New Chapter');
|
->assertElementNotContains('.actions', 'New Chapter');
|
||||||
|
|
||||||
|
@ -357,7 +357,7 @@ class RolesTest extends TestCase
|
|||||||
$ownShelf->getUrl() => 'Edit',
|
$ownShelf->getUrl() => 'Edit',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$resp = $this->get($otherShelf->getUrl());
|
$resp = $this->get($otherShelf->getUrl());
|
||||||
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'Edit');
|
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'Edit');
|
||||||
$this->get($otherShelf->getUrl('/edit'))->assertRedirect('/');
|
$this->get($otherShelf->getUrl('/edit'))->assertRedirect('/');
|
||||||
}
|
}
|
||||||
@ -388,7 +388,7 @@ class RolesTest extends TestCase
|
|||||||
$ownShelf->getUrl() => 'Delete',
|
$ownShelf->getUrl() => 'Delete',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$resp = $this->get($otherShelf->getUrl());
|
$resp = $this->get($otherShelf->getUrl());
|
||||||
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'Delete');
|
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'Delete');
|
||||||
$this->get($otherShelf->getUrl('/delete'))->assertRedirect('/');
|
$this->get($otherShelf->getUrl('/delete'))->assertRedirect('/');
|
||||||
|
|
||||||
@ -437,7 +437,7 @@ class RolesTest extends TestCase
|
|||||||
$ownBook->getUrl() => 'Edit',
|
$ownBook->getUrl() => 'Edit',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$resp = $this->get($otherBook->getUrl());
|
$resp = $this->get($otherBook->getUrl());
|
||||||
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'Edit');
|
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'Edit');
|
||||||
$this->get($otherBook->getUrl('/edit'))->assertRedirect('/');
|
$this->get($otherBook->getUrl('/edit'))->assertRedirect('/');
|
||||||
}
|
}
|
||||||
@ -465,7 +465,7 @@ class RolesTest extends TestCase
|
|||||||
$ownBook->getUrl() => 'Delete',
|
$ownBook->getUrl() => 'Delete',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$resp = $this->get($otherBook->getUrl());
|
$resp = $this->get($otherBook->getUrl());
|
||||||
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'Delete');
|
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'Delete');
|
||||||
$this->get($otherBook->getUrl('/delete'))->assertRedirect('/');
|
$this->get($otherBook->getUrl('/delete'))->assertRedirect('/');
|
||||||
$this->get($ownBook->getUrl());
|
$this->get($ownBook->getUrl());
|
||||||
@ -505,7 +505,7 @@ class RolesTest extends TestCase
|
|||||||
'description' => 'chapter desc',
|
'description' => 'chapter desc',
|
||||||
])->assertRedirect($ownBook->getUrl('/chapter/test-chapter'));
|
])->assertRedirect($ownBook->getUrl('/chapter/test-chapter'));
|
||||||
|
|
||||||
$resp = $this->get($book->getUrl());
|
$resp = $this->get($book->getUrl());
|
||||||
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'New Chapter');
|
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'New Chapter');
|
||||||
$this->get($book->getUrl('/create-chapter'))->assertRedirect('/');
|
$this->get($book->getUrl('/create-chapter'))->assertRedirect('/');
|
||||||
}
|
}
|
||||||
@ -537,7 +537,7 @@ class RolesTest extends TestCase
|
|||||||
$ownChapter->getUrl() => 'Edit',
|
$ownChapter->getUrl() => 'Edit',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$resp = $this->get($otherChapter->getUrl());
|
$resp = $this->get($otherChapter->getUrl());
|
||||||
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'Edit');
|
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'Edit');
|
||||||
$this->get($otherChapter->getUrl('/edit'))->assertRedirect('/');
|
$this->get($otherChapter->getUrl('/edit'))->assertRedirect('/');
|
||||||
}
|
}
|
||||||
@ -566,12 +566,12 @@ class RolesTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$bookUrl = $ownChapter->book->getUrl();
|
$bookUrl = $ownChapter->book->getUrl();
|
||||||
$resp = $this->get($otherChapter->getUrl());
|
$resp = $this->get($otherChapter->getUrl());
|
||||||
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'Delete');
|
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'Delete');
|
||||||
$this->get($otherChapter->getUrl('/delete'))->assertRedirect('/');
|
$this->get($otherChapter->getUrl('/delete'))->assertRedirect('/');
|
||||||
$this->get($ownChapter->getUrl());
|
$this->get($ownChapter->getUrl());
|
||||||
$this->delete($ownChapter->getUrl())->assertRedirect($bookUrl);
|
$this->delete($ownChapter->getUrl())->assertRedirect($bookUrl);
|
||||||
$resp = $this->get($bookUrl);
|
$resp = $this->get($bookUrl);
|
||||||
$this->withHtml($resp)->assertElementNotContains('.book-content', $ownChapter->name);
|
$this->withHtml($resp)->assertElementNotContains('.book-content', $ownChapter->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -589,7 +589,7 @@ class RolesTest extends TestCase
|
|||||||
$bookUrl = $otherChapter->book->getUrl();
|
$bookUrl = $otherChapter->book->getUrl();
|
||||||
$this->get($otherChapter->getUrl());
|
$this->get($otherChapter->getUrl());
|
||||||
$this->delete($otherChapter->getUrl())->assertRedirect($bookUrl);
|
$this->delete($otherChapter->getUrl())->assertRedirect($bookUrl);
|
||||||
$resp = $this->get($bookUrl);
|
$resp = $this->get($bookUrl);
|
||||||
$this->withHtml($resp)->assertElementNotContains('.book-content', $otherChapter->name);
|
$this->withHtml($resp)->assertElementNotContains('.book-content', $otherChapter->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -633,11 +633,11 @@ class RolesTest extends TestCase
|
|||||||
'html' => 'page desc',
|
'html' => 'page desc',
|
||||||
])->assertRedirect($ownBook->getUrl('/page/test-page'));
|
])->assertRedirect($ownBook->getUrl('/page/test-page'));
|
||||||
|
|
||||||
$resp = $this->get($book->getUrl());
|
$resp = $this->get($book->getUrl());
|
||||||
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'New Page');
|
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'New Page');
|
||||||
$this->get($book->getUrl('/create-page'))->assertRedirect('/');
|
$this->get($book->getUrl('/create-page'))->assertRedirect('/');
|
||||||
|
|
||||||
$resp = $this->get($chapter->getUrl());
|
$resp = $this->get($chapter->getUrl());
|
||||||
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'New Page');
|
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'New Page');
|
||||||
$this->get($chapter->getUrl('/create-page'))->assertRedirect('/');
|
$this->get($chapter->getUrl('/create-page'))->assertRedirect('/');
|
||||||
}
|
}
|
||||||
@ -698,7 +698,7 @@ class RolesTest extends TestCase
|
|||||||
$ownPage->getUrl() => 'Edit',
|
$ownPage->getUrl() => 'Edit',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$resp = $this->get($otherPage->getUrl());
|
$resp = $this->get($otherPage->getUrl());
|
||||||
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'Edit');
|
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'Edit');
|
||||||
$this->get($otherPage->getUrl() . '/edit')->assertRedirect('/');
|
$this->get($otherPage->getUrl() . '/edit')->assertRedirect('/');
|
||||||
}
|
}
|
||||||
@ -727,12 +727,12 @@ class RolesTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$parent = $ownPage->chapter ?? $ownPage->book;
|
$parent = $ownPage->chapter ?? $ownPage->book;
|
||||||
$resp = $this->get($otherPage->getUrl());
|
$resp = $this->get($otherPage->getUrl());
|
||||||
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'Delete');
|
$this->withHtml($resp)->assertElementNotContains('.action-buttons', 'Delete');
|
||||||
$this->get($otherPage->getUrl('/delete'))->assertRedirect('/');
|
$this->get($otherPage->getUrl('/delete'))->assertRedirect('/');
|
||||||
$this->get($ownPage->getUrl());
|
$this->get($ownPage->getUrl());
|
||||||
$this->delete($ownPage->getUrl())->assertRedirect($parent->getUrl());
|
$this->delete($ownPage->getUrl())->assertRedirect($parent->getUrl());
|
||||||
$resp = $this->get($parent->getUrl());
|
$resp = $this->get($parent->getUrl());
|
||||||
$this->withHtml($resp)->assertElementNotContains('.book-content', $ownPage->name);
|
$this->withHtml($resp)->assertElementNotContains('.book-content', $ownPage->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ class UserManagementTest extends TestCase
|
|||||||
$resp = $this->asAdmin()->get('/settings/users');
|
$resp = $this->asAdmin()->get('/settings/users');
|
||||||
$this->withHtml($resp)->assertElementContains('a[href="' . url('/settings/users/create') . '"]', 'Add New User');
|
$this->withHtml($resp)->assertElementContains('a[href="' . url('/settings/users/create') . '"]', 'Add New User');
|
||||||
|
|
||||||
$resp =$this->get('/settings/users/create');
|
$resp = $this->get('/settings/users/create');
|
||||||
$this->withHtml($resp)->assertElementContains('form[action="' . url('/settings/users/create') . '"]', 'Save');
|
$this->withHtml($resp)->assertElementContains('form[action="' . url('/settings/users/create') . '"]', 'Save');
|
||||||
|
|
||||||
$resp = $this->post('/settings/users/create', [
|
$resp = $this->post('/settings/users/create', [
|
||||||
|
@ -149,6 +149,5 @@ class UserPreferencesTest extends TestCase
|
|||||||
$this->withHtml($resp)
|
$this->withHtml($resp)
|
||||||
->assertElementExists('.featured-image-container')
|
->assertElementExists('.featured-image-container')
|
||||||
->assertElementNotExists('.content-wrap .entity-list-item');
|
->assertElementNotExists('.content-wrap .entity-list-item');
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user