Fix unit tests for eggs
This commit is contained in:
parent
0f4f2235a3
commit
0c2bd416ee
14 changed files with 130 additions and 200 deletions
|
@ -1,11 +1,4 @@
|
|||
<?php
|
||||
/**
|
||||
* Pterodactyl - Panel
|
||||
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
||||
*
|
||||
* This software is licensed under the terms of the MIT license.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
namespace Pterodactyl\Services\Eggs\Scripts;
|
||||
|
||||
|
@ -40,12 +33,8 @@ class InstallScriptService
|
|||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||
* @throws \Pterodactyl\Exceptions\Service\Egg\InvalidCopyFromException
|
||||
*/
|
||||
public function handle($egg, array $data)
|
||||
public function handle(Egg $egg, array $data)
|
||||
{
|
||||
if (! $egg instanceof Egg) {
|
||||
$egg = $this->repository->find($egg);
|
||||
}
|
||||
|
||||
if (! is_null(array_get($data, 'copy_script_from'))) {
|
||||
if (! $this->repository->isCopyableScript(array_get($data, 'copy_script_from'), $egg->nest_id)) {
|
||||
throw new InvalidCopyFromException(trans('exceptions.nest.egg.invalid_copy_id'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue