Applied latest StyleCI changes

This commit is contained in:
Dan Brown 2021-12-20 17:40:27 +00:00
parent 21f2a7087c
commit fc109f7e1c
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
5 changed files with 7 additions and 8 deletions

View File

@ -16,7 +16,6 @@ use Illuminate\Http\UploadedFile;
class Cloner class Cloner
{ {
/** /**
* @var PageRepo * @var PageRepo
*/ */
@ -96,7 +95,6 @@ class Cloner
$directChildren = $original->getDirectChildren(); $directChildren = $original->getDirectChildren();
foreach ($directChildren as $child) { foreach ($directChildren as $child) {
if ($child instanceof Chapter && userCan('chapter-create', $copyBook)) { if ($child instanceof Chapter && userCan('chapter-create', $copyBook)) {
$this->cloneChapter($child, $copyBook, $child->name); $this->cloneChapter($child, $copyBook, $child->name);
} }
@ -146,5 +144,4 @@ class Cloner
return $tags; return $tags;
} }
} }

View File

@ -204,7 +204,7 @@ class ChapterController extends Controller
session()->flashInput(['name' => $chapter->name]); session()->flashInput(['name' => $chapter->name]);
return view('chapters.copy', [ return view('chapters.copy', [
'book' => $chapter->book, 'book' => $chapter->book,
'chapter' => $chapter, 'chapter' => $chapter,
]); ]);
} }
@ -225,6 +225,7 @@ class ChapterController extends Controller
if (is_null($newParentBook)) { if (is_null($newParentBook)) {
$this->showErrorNotification(trans('errors.selected_book_not_found')); $this->showErrorNotification(trans('errors.selected_book_not_found'));
return redirect()->back(); return redirect()->back();
} }

View File

@ -458,6 +458,7 @@ class PageController extends Controller
if (is_null($newParent)) { if (is_null($newParent)) {
$this->showErrorNotification(trans('errors.selected_book_chapter_not_found')); $this->showErrorNotification(trans('errors.selected_book_chapter_not_found'));
return redirect()->back(); return redirect()->back();
} }

View File

@ -74,7 +74,7 @@ class ChapterTest extends TestCase
$resp->assertOk(); $resp->assertOk();
$resp->assertSee('Copy Chapter'); $resp->assertSee('Copy Chapter');
$resp->assertElementExists("input[name=\"name\"][value=\"{$chapter->name}\"]"); $resp->assertElementExists("input[name=\"name\"][value=\"{$chapter->name}\"]");
$resp->assertElementExists("input[name=\"entity_selection\"]"); $resp->assertElementExists('input[name="entity_selection"]');
} }
public function test_copy() public function test_copy()
@ -85,7 +85,7 @@ class ChapterTest extends TestCase
$otherBook = Book::query()->where('id', '!=', $chapter->book_id)->first(); $otherBook = Book::query()->where('id', '!=', $chapter->book_id)->first();
$resp = $this->asEditor()->post($chapter->getUrl('/copy'), [ $resp = $this->asEditor()->post($chapter->getUrl('/copy'), [
'name' => 'My copied chapter', 'name' => 'My copied chapter',
'entity_selection' => 'book:' . $otherBook->id, 'entity_selection' => 'book:' . $otherBook->id,
]); ]);

View File

@ -177,7 +177,7 @@ class RolesTest extends TestCase
$role = Role::query()->first(); $role = Role::query()->first();
$resp = $this->asAdmin()->get("/settings/roles/new?copy_from={$role->id}"); $resp = $this->asAdmin()->get("/settings/roles/new?copy_from={$role->id}");
$resp->assertOk(); $resp->assertOk();
$resp->assertElementExists('input[name="display_name"][value="' . ($role->display_name . ' (Copy)') . '"]'); $resp->assertElementExists('input[name="display_name"][value="' . ($role->display_name . ' (Copy)') . '"]');
} }
public function test_manage_user_permission() public function test_manage_user_permission()