}
// Strip thumbnail element from path if existing
- $originalPathSplit = array_filter(explode('/', $path), function(string $part) {
+ $originalPathSplit = array_filter(explode('/', $path), function (string $part) {
$resizedDir = (strpos($part, 'thumbs-') === 0 || strpos($part, 'scaled-') === 0);
$missingExtension = strpos($part, '.') === false;
+
return !($resizedDir && $missingExtension);
});
{
$shelf = Bookshelf::first();
$resp = $this->asEditor()->get($shelf->getUrl('/edit'));
- $resp->assertSeeText('Edit Bookshelf');
+ $resp->assertSeeText('Edit Shelf');
$booksToInclude = Book::take(2)->get();
$shelfInfo = [
$bookCount = $shelf->books()->count();
$deleteViewReq = $this->asEditor()->get($shelf->getUrl('/delete'));
- $deleteViewReq->assertSeeText('Are you sure you want to delete this bookshelf?');
+ $deleteViewReq->assertSeeText('Are you sure you want to delete this shelf?');
$deleteReq = $this->delete($shelf->getUrl());
$deleteReq->assertRedirect(url('/shelves'));
$this->assertTrue($shelf->deletions()->count() === 1);
$redirectReq = $this->get($deleteReq->baseResponse->headers->get('location'));
- $this->assertNotificationContains($redirectReq, 'Bookshelf Successfully Deleted');
+ $this->assertNotificationContains($redirectReq, 'Shelf Successfully Deleted');
}
public function test_shelf_copy_permissions()
{
$shelf = Bookshelf::first();
$resp = $this->asAdmin()->get($shelf->getUrl('/permissions'));
- $resp->assertSeeText('Permissions on bookshelves do not automatically cascade to contained books.');
+ $resp->assertSeeText('Permissions on shelves do not automatically cascade to contained books.');
}
public function test_bookshelves_show_in_breadcrumbs_if_in_context()
$this->put('/ajax/page/' . $draft->id . '/save-draft', [
'name' => 'My page',
- 'markdown' => "Update test",
+ 'markdown' => 'Update test',
])->assertOk();
$draft->refresh();
$this->post($draft->getUrl(), [
'name' => 'My page',
- 'markdown' => "# My markdown page"
+ 'markdown' => '# My markdown page',
]);
$this->assertDatabaseHas('pages', [
$this->setRestrictionsForTestRoles($shelf, []);
$this->followingRedirects()->get($shelf->getUrl())
- ->assertSee('Bookshelf not found');
+ ->assertSee('Shelf not found');
$this->setRestrictionsForTestRoles($shelf, ['view']);
$this->actingAs($this->user)
->get($shelf->getUrl('/edit'))
- ->assertSee('Edit Book');
+ ->assertSee('Edit Shelf');
$this->setRestrictionsForTestRoles($shelf, ['view', 'delete']);
$this->actingAs($this->user)
->get($shelf->getUrl('/delete'))
- ->assertSee('Delete Book');
+ ->assertSee('Delete Shelf');
$this->setRestrictionsForTestRoles($shelf, ['view', 'update']);
$this->get($shelf->getUrl('/delete'))
->assertOk()
- ->assertSee('Delete Book');
+ ->assertSee('Delete Shelf');
}
public function test_book_view_restriction()
public function test_bookshelf_restriction_form()
{
- $this->entityRestrictionFormTest(Bookshelf::class, 'Bookshelf Permissions', 'view', '2');
+ $this->entityRestrictionFormTest(Bookshelf::class, 'Shelf Permissions', 'view', '2');
}
public function test_book_restriction_form()
$this->setRestrictionsForTestRoles($shelf, ['view', 'delete']);
- $this->get($shelf->getUrl('/delete'))->assertOk()->assertSee('Delete Book');
+ $this->get($shelf->getUrl('/delete'))->assertOk()->assertSee('Delete Shelf');
}
public function test_book_create_restriction_override()