Add test for new command

This commit is contained in:
Dane Everitt 2018-03-02 21:26:42 -06:00
parent 021710aa1c
commit 0135f7ee8e
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 167 additions and 1 deletions

View file

@ -4,6 +4,7 @@ namespace Pterodactyl\Console\Commands\Server;
use Illuminate\Console\Command;
use GuzzleHttp\Exception\RequestException;
use Illuminate\Validation\ValidationException;
use Illuminate\Validation\Factory as ValidatorFactory;
use Pterodactyl\Contracts\Repository\ServerRepositoryInterface;
use Pterodactyl\Contracts\Repository\Daemon\PowerRepositoryInterface;
@ -60,6 +61,7 @@ class BulkPowerActionCommand extends Command
/**
* Handle the bulk power request.
*
* @throws \Illuminate\Validation\ValidationException
* @throws \Pterodactyl\Exceptions\Repository\Daemon\InvalidPowerSignalException
*/
public function handle()
@ -85,7 +87,7 @@ class BulkPowerActionCommand extends Command
$this->output->error($message);
}
return;
throw new ValidationException($validator);
}
$count = $this->repository->getServersForPowerActionCount($servers, $nodes);