Apply fixes from StyleCI (#590)

This commit is contained in:
Dane Everitt 2017-08-15 23:21:01 -05:00 committed by GitHub
parent 1260a8384a
commit 46cb71e69d
13 changed files with 47 additions and 48 deletions

View file

@ -30,6 +30,7 @@ use Prologue\Alerts\AlertsMessageBag;
use Pterodactyl\Models\ServiceOption;
use Pterodactyl\Http\Controllers\Controller;
use Pterodactyl\Http\Requests\Admin\Service\EditOptionScript;
use Pterodactyl\Exceptions\Services\HasActiveServersException;
use Pterodactyl\Services\Services\Options\OptionUpdateService;
use Pterodactyl\Contracts\Repository\ServiceRepositoryInterface;
use Pterodactyl\Services\Services\Options\OptionCreationService;
@ -38,7 +39,6 @@ use Pterodactyl\Http\Requests\Admin\Service\ServiceOptionFormRequest;
use Pterodactyl\Services\Services\Options\InstallScriptUpdateService;
use Pterodactyl\Contracts\Repository\ServiceOptionRepositoryInterface;
use Pterodactyl\Exceptions\Services\ServiceOption\InvalidCopyFromException;
use Pterodactyl\Exceptions\Services\HasActiveServersException;
use Pterodactyl\Exceptions\Services\ServiceOption\NoParentConfigurationFoundException;
class OptionController extends Controller

View file

@ -24,9 +24,9 @@
namespace Pterodactyl\Services\Services\Options;
use Pterodactyl\Exceptions\Services\HasActiveServersException;
use Pterodactyl\Contracts\Repository\ServerRepositoryInterface;
use Pterodactyl\Contracts\Repository\ServiceOptionRepositoryInterface;
use Pterodactyl\Exceptions\Services\HasActiveServersException;
class OptionDeletionService
{

View file

@ -25,13 +25,13 @@
namespace Tests\Unit\Http\Controllers\Admin;
use Mockery as m;
use Prologue\Alerts\AlertsMessageBag;
use Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface;
use Pterodactyl\Contracts\Repository\LocationRepositoryInterface;
use Pterodactyl\Http\Controllers\Admin\DatabaseController;
use Pterodactyl\Services\Database\DatabaseHostService;
use Tests\Assertions\ControllerAssertionsTrait;
use Tests\TestCase;
use Prologue\Alerts\AlertsMessageBag;
use Tests\Assertions\ControllerAssertionsTrait;
use Pterodactyl\Services\Database\DatabaseHostService;
use Pterodactyl\Http\Controllers\Admin\DatabaseController;
use Pterodactyl\Contracts\Repository\LocationRepositoryInterface;
use Pterodactyl\Contracts\Repository\DatabaseHostRepositoryInterface;
class DatabaseControllerTest extends TestCase
{

View file

@ -25,13 +25,13 @@
namespace Tests\Unit\Services\Servers;
use Exception;
use GuzzleHttp\Exception\RequestException;
use Mockery as m;
use Pterodactyl\Exceptions\DisplayException;
use Tests\TestCase;
use Illuminate\Log\Writer;
use phpmock\phpunit\PHPMock;
use Illuminate\Database\DatabaseManager;
use GuzzleHttp\Exception\RequestException;
use Pterodactyl\Exceptions\DisplayException;
use Pterodactyl\Services\Servers\CreationService;
use Pterodactyl\Services\Servers\VariableValidatorService;
use Pterodactyl\Services\Servers\UsernameGenerationService;

View file

@ -25,18 +25,18 @@
namespace Tests\Unit\Services\Servers;
use Exception;
use GuzzleHttp\Exception\RequestException;
use Illuminate\Log\Writer;
use Mockery as m;
use Illuminate\Database\ConnectionInterface;
use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface;
use Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface;
use Pterodactyl\Contracts\Repository\ServerRepositoryInterface;
use Pterodactyl\Exceptions\DisplayException;
use Pterodactyl\Models\Server;
use Pterodactyl\Services\Database\DatabaseManagementService;
use Pterodactyl\Services\Servers\DeletionService;
use Tests\TestCase;
use Illuminate\Log\Writer;
use Pterodactyl\Models\Server;
use GuzzleHttp\Exception\RequestException;
use Illuminate\Database\ConnectionInterface;
use Pterodactyl\Exceptions\DisplayException;
use Pterodactyl\Services\Servers\DeletionService;
use Pterodactyl\Services\Database\DatabaseManagementService;
use Pterodactyl\Contracts\Repository\ServerRepositoryInterface;
use Pterodactyl\Contracts\Repository\DatabaseRepositoryInterface;
use Pterodactyl\Contracts\Repository\Daemon\ServerRepositoryInterface as DaemonServerRepositoryInterface;
class DeletionServiceTest extends TestCase
{

View file

@ -90,7 +90,7 @@ class OptionCreationServiceTest extends TestCase
$this->repository->shouldReceive('findCountWhere')->with([
['service_id', '=', $data['service_id']],
['id', '=', $data['config_from']]
['id', '=', $data['config_from']],
])->once()->andReturn(1);
$this->repository->shouldReceive('create')->with($data)
@ -109,7 +109,7 @@ class OptionCreationServiceTest extends TestCase
{
$this->repository->shouldReceive('findCountWhere')->with([
['service_id', '=', null],
['id', '=', 1]
['id', '=', 1],
])->once()->andReturn(0);
try {

View file

@ -25,11 +25,11 @@
namespace Tests\Unit\Services\Services\Options;
use Mockery as m;
use Pterodactyl\Contracts\Repository\ServerRepositoryInterface;
use Pterodactyl\Contracts\Repository\ServiceOptionRepositoryInterface;
use Pterodactyl\Exceptions\Services\HasActiveServersException;
use Pterodactyl\Services\Services\Options\OptionDeletionService;
use Tests\TestCase;
use Pterodactyl\Exceptions\Services\HasActiveServersException;
use Pterodactyl\Contracts\Repository\ServerRepositoryInterface;
use Pterodactyl\Services\Services\Options\OptionDeletionService;
use Pterodactyl\Contracts\Repository\ServiceOptionRepositoryInterface;
class OptionDeletionServiceTest extends TestCase
{

View file

@ -26,11 +26,11 @@ namespace Tests\Unit\Services\Services\Options;
use Exception;
use Mockery as m;
use Pterodactyl\Contracts\Repository\ServiceOptionRepositoryInterface;
use Pterodactyl\Exceptions\Services\ServiceOption\NoParentConfigurationFoundException;
use Tests\TestCase;
use Pterodactyl\Models\ServiceOption;
use Pterodactyl\Services\Services\Options\OptionUpdateService;
use Tests\TestCase;
use Pterodactyl\Contracts\Repository\ServiceOptionRepositoryInterface;
use Pterodactyl\Exceptions\Services\ServiceOption\NoParentConfigurationFoundException;
class OptionUpdateServiceTest extends TestCase
{

View file

@ -25,12 +25,12 @@
namespace Tests\Unit\Services\Services;
use Mockery as m;
use Pterodactyl\Contracts\Repository\ServiceRepositoryInterface;
use Pterodactyl\Models\Service;
use Pterodactyl\Services\Services\ServiceCreationService;
use Pterodactyl\Traits\Services\CreatesServiceIndex;
use Tests\TestCase;
use Pterodactyl\Models\Service;
use Illuminate\Contracts\Config\Repository;
use Pterodactyl\Traits\Services\CreatesServiceIndex;
use Pterodactyl\Services\Services\ServiceCreationService;
use Pterodactyl\Contracts\Repository\ServiceRepositoryInterface;
class ServiceCreationServiceTest extends TestCase
{

View file

@ -26,11 +26,11 @@ namespace Tests\Unit\Services\Services;
use Exception;
use Mockery as m;
use Tests\TestCase;
use Pterodactyl\Services\Services\ServiceDeletionService;
use Pterodactyl\Exceptions\Services\HasActiveServersException;
use Pterodactyl\Contracts\Repository\ServerRepositoryInterface;
use Pterodactyl\Contracts\Repository\ServiceRepositoryInterface;
use Pterodactyl\Exceptions\Services\HasActiveServersException;
use Pterodactyl\Services\Services\ServiceDeletionService;
use Tests\TestCase;
class ServiceDeletionServiceTest extends TestCase
{

View file

@ -25,9 +25,9 @@
namespace Tests\Unit\Services\Services;
use Mockery as m;
use Pterodactyl\Contracts\Repository\ServiceRepositoryInterface;
use Pterodactyl\Services\Services\ServiceUpdateService;
use Tests\TestCase;
use Pterodactyl\Services\Services\ServiceUpdateService;
use Pterodactyl\Contracts\Repository\ServiceRepositoryInterface;
class ServiceUpdateServiceTest extends TestCase
{

View file

@ -25,13 +25,12 @@
namespace Tests\Unit\Services\Services\Variables;
use Mockery as m;
use Pterodactyl\Contracts\Repository\ServiceOptionRepositoryInterface;
use Pterodactyl\Contracts\Repository\ServiceVariableRepositoryInterface;
use Pterodactyl\Exceptions\Services\ServiceVariable\ReservedVariableNameException;
use Tests\TestCase;
use Pterodactyl\Models\ServiceOption;
use Pterodactyl\Models\ServiceVariable;
use Pterodactyl\Services\Services\Variables\VariableCreationService;
use Tests\TestCase;
use Pterodactyl\Contracts\Repository\ServiceOptionRepositoryInterface;
use Pterodactyl\Contracts\Repository\ServiceVariableRepositoryInterface;
class VariableCreationServiceTest extends TestCase
{

View file

@ -26,11 +26,11 @@ namespace Tests\Unit\Services\Services\Variables;
use Exception;
use Mockery as m;
use PhpParser\Node\Expr\Variable;
use Pterodactyl\Exceptions\DisplayException;
use Pterodactyl\Models\ServiceVariable;
use Pterodactyl\Services\Services\Variables\VariableUpdateService;
use Tests\TestCase;
use PhpParser\Node\Expr\Variable;
use Pterodactyl\Models\ServiceVariable;
use Pterodactyl\Exceptions\DisplayException;
use Pterodactyl\Services\Services\Variables\VariableUpdateService;
use Pterodactyl\Contracts\Repository\ServiceVariableRepositoryInterface;
class VariableUpdateServiceTest extends TestCase
@ -87,7 +87,7 @@ class VariableUpdateServiceTest extends TestCase
->shouldReceive('findCountWhere')->with([
['env_variable', '=', 'TEST_VAR_123'],
['option_id', '=', $this->model->option_id],
['id', '!=', $this->model->id]
['id', '!=', $this->model->id],
])->once()->andReturn(0);
$this->repository->shouldReceive('withoutFresh')->withNoArgs()->once()->andReturnSelf()
@ -109,7 +109,7 @@ class VariableUpdateServiceTest extends TestCase
->shouldReceive('findCountWhere')->with([
['env_variable', '=', 'TEST_VAR_123'],
['option_id', '=', $this->model->option_id],
['id', '!=', $this->model->id]
['id', '!=', $this->model->id],
])->once()->andReturn(1);
try {