Skip to content

Commit fbd5c25

Browse files
committed
Finalize tests
1 parent 609bf32 commit fbd5c25

File tree

6 files changed

+11
-5
lines changed

6 files changed

+11
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
1212
* New CLI command to disabled 2-Factor Authentication on an account if necessary.
1313
* Ability to delete users and locations via the CLI.
1414
* You can now require 2FA for all users, admins only, or at will using a simple configuration in the Admin CP.
15+
* Added ability to export and import service options and their associated settings and environment variables via the Admin CP.
1516

1617
### Changed
1718
* Theme colors and login pages updated to give a more unique feel to the project.

app/Services/Services/Options/InstallScriptUpdateService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct(ServiceOptionRepositoryInterface $repository)
4040
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
4141
* @throws \Pterodactyl\Exceptions\Service\ServiceOption\InvalidCopyFromException
4242
*/
43-
public function handle($option, array $data): void
43+
public function handle($option, array $data)
4444
{
4545
if (! $option instanceof ServiceOption) {
4646
$option = $this->repository->find($option);

app/Services/Services/Options/OptionUpdateService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct(ServiceOptionRepositoryInterface $repository)
4040
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
4141
* @throws \Pterodactyl\Exceptions\Service\ServiceOption\NoParentConfigurationFoundException
4242
*/
43-
public function handle($option, array $data): void
43+
public function handle($option, array $data)
4444
{
4545
if (! $option instanceof ServiceOption) {
4646
$option = $this->repository->find($option);

app/Services/Services/ServiceUpdateService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(ServiceRepositoryInterface $repository)
3636
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
3737
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
3838
*/
39-
public function handle(int $service, array $data): void
39+
public function handle(int $service, array $data)
4040
{
4141
if (! is_null(array_get($data, 'author'))) {
4242
unset($data['author']);

tests/Unit/Services/Services/Options/OptionCreationServiceTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,16 @@ public function setUp()
6060
*/
6161
public function testCreateNewModelWithoutUsingConfigFrom()
6262
{
63-
$model = factory(ServiceOption::class)->make();
63+
$model = factory(ServiceOption::class)->make([
64+
'tag' => str_random(10),
65+
]);
6466

6567
$this->config->shouldReceive('get')->with('pterodactyl.service.author')->once()->andReturn('test@example.com');
6668
$this->uuid->shouldReceive('uuid4->toString')->withNoArgs()->once()->andReturn('uuid-string');
6769
$this->repository->shouldReceive('create')->with([
6870
'name' => $model->name,
69-
'config_from' => null,
7071
'tag' => 'test@example.com:' . $model->tag,
72+
'config_from' => null,
7173
'uuid' => 'uuid-string',
7274
], true, true)->once()->andReturn($model);
7375

tests/Unit/Services/Services/Sharing/ServiceOptionExporterServiceTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ public function setUp()
5151
$this->service = new ServiceOptionExporterService($this->carbon, $this->repository);
5252
}
5353

54+
/**
55+
* Test that a JSON structure is returned.
56+
*/
5457
public function testJsonStructureIsExported()
5558
{
5659
$option = factory(ServiceOption::class)->make();

0 commit comments

Comments
 (0)