Fixed failing tests due to shelf text changes, applied styleci changes
This commit is contained in:
parent
5736919836
commit
7f8b3eff5a
|
@ -561,9 +561,10 @@ class ImageService
|
||||||
}
|
}
|
||||||
|
|
||||||
// Strip thumbnail element from path if existing
|
// 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);
|
$resizedDir = (strpos($part, 'thumbs-') === 0 || strpos($part, 'scaled-') === 0);
|
||||||
$missingExtension = strpos($part, '.') === false;
|
$missingExtension = strpos($part, '.') === false;
|
||||||
|
|
||||||
return !($resizedDir && $missingExtension);
|
return !($resizedDir && $missingExtension);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -203,7 +203,7 @@ class BookShelfTest extends TestCase
|
||||||
{
|
{
|
||||||
$shelf = Bookshelf::first();
|
$shelf = Bookshelf::first();
|
||||||
$resp = $this->asEditor()->get($shelf->getUrl('/edit'));
|
$resp = $this->asEditor()->get($shelf->getUrl('/edit'));
|
||||||
$resp->assertSeeText('Edit Bookshelf');
|
$resp->assertSeeText('Edit Shelf');
|
||||||
|
|
||||||
$booksToInclude = Book::take(2)->get();
|
$booksToInclude = Book::take(2)->get();
|
||||||
$shelfInfo = [
|
$shelfInfo = [
|
||||||
|
@ -270,7 +270,7 @@ class BookShelfTest extends TestCase
|
||||||
$bookCount = $shelf->books()->count();
|
$bookCount = $shelf->books()->count();
|
||||||
|
|
||||||
$deleteViewReq = $this->asEditor()->get($shelf->getUrl('/delete'));
|
$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 = $this->delete($shelf->getUrl());
|
||||||
$deleteReq->assertRedirect(url('/shelves'));
|
$deleteReq->assertRedirect(url('/shelves'));
|
||||||
|
@ -283,7 +283,7 @@ class BookShelfTest extends TestCase
|
||||||
$this->assertTrue($shelf->deletions()->count() === 1);
|
$this->assertTrue($shelf->deletions()->count() === 1);
|
||||||
|
|
||||||
$redirectReq = $this->get($deleteReq->baseResponse->headers->get('location'));
|
$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()
|
public function test_shelf_copy_permissions()
|
||||||
|
@ -313,7 +313,7 @@ class BookShelfTest extends TestCase
|
||||||
{
|
{
|
||||||
$shelf = Bookshelf::first();
|
$shelf = Bookshelf::first();
|
||||||
$resp = $this->asAdmin()->get($shelf->getUrl('/permissions'));
|
$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()
|
public function test_bookshelves_show_in_breadcrumbs_if_in_context()
|
||||||
|
|
|
@ -215,7 +215,7 @@ class PageDraftTest extends TestCase
|
||||||
|
|
||||||
$this->put('/ajax/page/' . $draft->id . '/save-draft', [
|
$this->put('/ajax/page/' . $draft->id . '/save-draft', [
|
||||||
'name' => 'My page',
|
'name' => 'My page',
|
||||||
'markdown' => "Update test",
|
'markdown' => 'Update test',
|
||||||
])->assertOk();
|
])->assertOk();
|
||||||
|
|
||||||
$draft->refresh();
|
$draft->refresh();
|
||||||
|
@ -223,7 +223,7 @@ class PageDraftTest extends TestCase
|
||||||
|
|
||||||
$this->post($draft->getUrl(), [
|
$this->post($draft->getUrl(), [
|
||||||
'name' => 'My page',
|
'name' => 'My page',
|
||||||
'markdown' => "# My markdown page"
|
'markdown' => '# My markdown page',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertDatabaseHas('pages', [
|
$this->assertDatabaseHas('pages', [
|
||||||
|
|
|
@ -51,7 +51,7 @@ class EntityPermissionsTest extends TestCase
|
||||||
$this->setRestrictionsForTestRoles($shelf, []);
|
$this->setRestrictionsForTestRoles($shelf, []);
|
||||||
|
|
||||||
$this->followingRedirects()->get($shelf->getUrl())
|
$this->followingRedirects()->get($shelf->getUrl())
|
||||||
->assertSee('Bookshelf not found');
|
->assertSee('Shelf not found');
|
||||||
|
|
||||||
$this->setRestrictionsForTestRoles($shelf, ['view']);
|
$this->setRestrictionsForTestRoles($shelf, ['view']);
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ class EntityPermissionsTest extends TestCase
|
||||||
|
|
||||||
$this->actingAs($this->user)
|
$this->actingAs($this->user)
|
||||||
->get($shelf->getUrl('/edit'))
|
->get($shelf->getUrl('/edit'))
|
||||||
->assertSee('Edit Book');
|
->assertSee('Edit Shelf');
|
||||||
|
|
||||||
$this->setRestrictionsForTestRoles($shelf, ['view', 'delete']);
|
$this->setRestrictionsForTestRoles($shelf, ['view', 'delete']);
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ class EntityPermissionsTest extends TestCase
|
||||||
|
|
||||||
$this->actingAs($this->user)
|
$this->actingAs($this->user)
|
||||||
->get($shelf->getUrl('/delete'))
|
->get($shelf->getUrl('/delete'))
|
||||||
->assertSee('Delete Book');
|
->assertSee('Delete Shelf');
|
||||||
|
|
||||||
$this->setRestrictionsForTestRoles($shelf, ['view', 'update']);
|
$this->setRestrictionsForTestRoles($shelf, ['view', 'update']);
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ class EntityPermissionsTest extends TestCase
|
||||||
|
|
||||||
$this->get($shelf->getUrl('/delete'))
|
$this->get($shelf->getUrl('/delete'))
|
||||||
->assertOk()
|
->assertOk()
|
||||||
->assertSee('Delete Book');
|
->assertSee('Delete Shelf');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_book_view_restriction()
|
public function test_book_view_restriction()
|
||||||
|
@ -416,7 +416,7 @@ class EntityPermissionsTest extends TestCase
|
||||||
|
|
||||||
public function test_bookshelf_restriction_form()
|
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()
|
public function test_book_restriction_form()
|
||||||
|
@ -524,7 +524,7 @@ class EntityPermissionsTest extends TestCase
|
||||||
|
|
||||||
$this->setRestrictionsForTestRoles($shelf, ['view', 'delete']);
|
$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()
|
public function test_book_create_restriction_override()
|
||||||
|
|
Loading…
Reference in New Issue