From 756a21ff046237996e0bd41b8f81b9a26c1de87c Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Wed, 24 Jun 2020 20:38:13 -0700 Subject: [PATCH] Remove unused code --- .phpunit.result.cache | 2 +- app/Http/Kernel.php | 2 - .../Server/AuthenticateAsSubuser.php | 59 ----- app/Providers/RouteServiceProvider.php | 2 +- .../DaemonKeys/DaemonKeyCreationService.php | 87 ------- .../DaemonKeys/DaemonKeyProviderService.php | 121 --------- .../DaemonKeys/DaemonKeyUpdateService.php | 88 ------- .../Server/AuthenticateAsSubuserTest.php | 72 ------ .../AllocationDeletionServiceTest.php | 5 +- .../Allocations/AssignmentServiceTest.php | 27 ++- .../SetDefaultAllocationServiceTest.php | 156 ------------ .../DaemonKeyCreationServiceTest.php | 98 -------- .../DaemonKeyProviderServiceTest.php | 229 ------------------ .../DaemonKeys/DaemonKeyUpdateServiceTest.php | 83 ------- .../RevokeMultipleDaemonKeysServiceTest.php | 116 --------- 15 files changed, 21 insertions(+), 1126 deletions(-) delete mode 100644 app/Http/Middleware/Server/AuthenticateAsSubuser.php delete mode 100644 app/Services/DaemonKeys/DaemonKeyCreationService.php delete mode 100644 app/Services/DaemonKeys/DaemonKeyProviderService.php delete mode 100644 app/Services/DaemonKeys/DaemonKeyUpdateService.php delete mode 100644 tests/Unit/Http/Middleware/Server/AuthenticateAsSubuserTest.php delete mode 100644 tests/Unit/Services/Allocations/SetDefaultAllocationServiceTest.php delete mode 100644 tests/Unit/Services/DaemonKeys/DaemonKeyCreationServiceTest.php delete mode 100644 tests/Unit/Services/DaemonKeys/DaemonKeyProviderServiceTest.php delete mode 100644 tests/Unit/Services/DaemonKeys/DaemonKeyUpdateServiceTest.php delete mode 100644 tests/Unit/Services/DaemonKeys/RevokeMultipleDaemonKeysServiceTest.php diff --git a/.phpunit.result.cache b/.phpunit.result.cache index 90c076199..ef7eacd08 100644 --- a/.phpunit.result.cache +++ b/.phpunit.result.cache @@ -1 +1 @@ -C:37:"PHPUnit\Runner\DefaultTestResultCache":22007:{a:2:{s:7:"defects";a:42:{s:79:"Tests\Unit\Http\Controllers\Admin\StatisticsControllerTest::testIndexController";i:4;s:73:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testIndexController";i:4;s:74:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testStatusController";i:4;s:96:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testStatusControllerWhenServerNotInstalled";i:4;s:95:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testStatusControllerWhenServerIsSuspended";i:4;s:103:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testStatusControllerWithServerConnectionException";i:4;s:94:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testStatusControllerWithRequestException";i:4;s:87:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testIndexWithout2FactorEnabled";i:4;s:84:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testIndexWith2FactorEnabled";i:4;s:83:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testStore with data set #0";i:4;s:83:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testStore with data set #1";i:4;s:108:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testStoreWithInvalidTokenException with data set #0";i:4;s:108:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testStoreWithInvalidTokenException with data set #1";i:4;s:82:"Tests\Unit\Http\Middleware\API\Application\AuthenticateUserTest::testNoUserDefined";i:6;s:81:"Tests\Unit\Http\Middleware\API\Application\AuthenticateUserTest::testNonAdminUser";i:6;s:74:"Tests\Unit\Http\Middleware\API\AuthenticateIPAccessTest::testWithInvalidIP";i:6;s:73:"Tests\Unit\Http\Middleware\API\AuthenticateKeyTest::testInvalidIdentifier";i:6;s:81:"Tests\Unit\Http\Middleware\API\AuthenticateKeyTest::testInvalidTokenForIdentifier";i:6;s:105:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldContinueIfRouteIsExempted";i:4;s:103:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfNoTokenIsProvided";i:4;s:99:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfNoNodeIsFound";i:4;s:93:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testSuccessfulMiddlewareProcess";i:4;s:89:"Tests\Unit\Http\Middleware\AdminAuthenticateTest::testExceptionIsThrownIfUserDoesNotExist";i:6;s:89:"Tests\Unit\Http\Middleware\AdminAuthenticateTest::testExceptionIsThrownIfUserIsNotAnAdmin";i:6;s:62:"Tests\Unit\Http\Middleware\AuthenticateTest::testLoggedOutUser";i:6;s:76:"Tests\Unit\Http\Middleware\DaemonAuthenticateTest::testValidDaemonConnection";i:4;s:81:"Tests\Unit\Http\Middleware\DaemonAuthenticateTest::testIgnoredRouteShouldContinue";i:4;s:85:"Tests\Unit\Http\Middleware\DaemonAuthenticateTest::testExceptionThrownIfMissingHeader";i:3;s:100:"Tests\Unit\Http\Middleware\Server\AccessingValidServerTest::testExceptionIsThrownIfServerIsSuspended";i:6;s:103:"Tests\Unit\Http\Middleware\Server\AccessingValidServerTest::testExceptionIsThrownIfServerIsNotInstalled";i:6;s:98:"Tests\Unit\Http\Middleware\Server\AuthenticateAsSubuserTest::testExceptionIsThrownIfNoTokenIsFound";i:6;s:107:"Tests\Unit\Http\Middleware\Server\DatabaseBelongsToServerTest::testExceptionIsThrownIfNoDatabaseRecordFound";i:6;s:119:"Tests\Unit\Http\Middleware\Server\DatabaseBelongsToServerTest::testExceptionIsThrownIfDatabaseServerDoesNotMatchCurrent";i:6;s:115:"Tests\Unit\Http\Middleware\Server\ScheduleBelongsToServerTest::testExceptionIsThrownIfScheduleDoesNotBelongToServer";i:6;s:123:"Tests\Unit\Http\Middleware\Server\SubuserBelongsToServerTest::testExceptionIsThrownIfSubuserServerDoesNotMatchRequestServer";i:6;s:101:"Tests\Unit\Http\Middleware\Server\SubuserBelongsToServerTest::testExceptionIsThrownIfNoSubuserIsFound";i:6;s:100:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfNodeIsNotFound";i:5;s:56:"Tests\Unit\Jobs\Schedule\RunTaskJobTest::testPowerAction";i:4;s:58:"Tests\Unit\Jobs\Schedule\RunTaskJobTest::testCommandAction";i:4;s:67:"Tests\Unit\Jobs\Schedule\RunTaskJobTest::testNextTaskQueuedIfExists";i:4;s:69:"Tests\Unit\Jobs\Schedule\RunTaskJobTest::testInvalidActionPassedToJob";i:6;s:83:"Tests\Unit\Jobs\Schedule\RunTaskJobTest::testScheduleMarkedAsDisabledDoesNotProcess";i:4;}s:5:"times";a:172:{s:81:"Tests\Unit\Commands\Environment\EmailSettingsCommandTest::testSmtpDriverSelection";d:0.692;s:98:"Tests\Unit\Commands\Environment\EmailSettingsCommandTest::testSmtpDriverSelectionWithOptionsPassed";d:0.038;s:84:"Tests\Unit\Commands\Environment\EmailSettingsCommandTest::testPHPMailDriverSelection";d:0.046;s:84:"Tests\Unit\Commands\Environment\EmailSettingsCommandTest::testMailgunDriverSelection";d:0.05;s:101:"Tests\Unit\Commands\Environment\EmailSettingsCommandTest::testMailgunDriverSelectionWithOptionsPassed";d:0.037;s:85:"Tests\Unit\Commands\Environment\EmailSettingsCommandTest::testMandrillDriverSelection";d:0.052;s:102:"Tests\Unit\Commands\Environment\EmailSettingsCommandTest::testMandrillDriverSelectionWithOptionsPassed";d:0.038;s:85:"Tests\Unit\Commands\Environment\EmailSettingsCommandTest::testPostmarkDriverSelection";d:0.051;s:102:"Tests\Unit\Commands\Environment\EmailSettingsCommandTest::testPostmarkDriverSelectionWithOptionsPassed";d:0.037;s:77:"Tests\Unit\Commands\Location\DeleteLocationCommandTest::testLocationIsDeleted";d:0.106;s:93:"Tests\Unit\Commands\Location\DeleteLocationCommandTest::testLocationIsDeletedIfPassedInOption";d:0.042;s:106:"Tests\Unit\Commands\Location\DeleteLocationCommandTest::testInteractiveEnvironmentAllowsReAttemptingSearch";d:0.06;s:115:"Tests\Unit\Commands\Location\DeleteLocationCommandTest::testNonInteractiveEnvironmentThrowsErrorIfNoLocationIsFound";d:0.041;s:94:"Tests\Unit\Commands\Location\MakeLocationCommandTest::testLocationIsCreatedWithNoOptionsPassed";d:0.044;s:95:"Tests\Unit\Commands\Location\MakeLocationCommandTest::testLocationIsCreatedWhenOptionsArePassed";d:0.045;s:109:"Tests\Unit\Commands\Maintenance\CleanServiceBackupFilesCommandTest::testCommandCleansFilesMoreThan5MinutesOld";d:0.044;s:114:"Tests\Unit\Commands\Maintenance\CleanServiceBackupFilesCommandTest::testCommandDoesNotCleanFileLessThan5MinutesOld";d:0.039;s:77:"Tests\Unit\Commands\Schedule\ProcessRunnableCommandTest::testScheduleIsQueued";d:0.062;s:94:"Tests\Unit\Commands\Schedule\ProcessRunnableCommandTest::testScheduleWithNoTasksIsNotProcessed";d:0.042;s:127:"Tests\Unit\Commands\Schedule\ProcessRunnableCommandTest::testScheduleWithTasksObjectThatIsNotInstanceOfCollectionIsNotProcessed";d:0.042;s:69:"Tests\Unit\Commands\Server\BulkPowerActionCommandTest::testSendAction";d:0.149;s:74:"Tests\Unit\Commands\Server\BulkPowerActionCommandTest::testSendWithFilters";d:0.05;s:79:"Tests\Unit\Commands\Server\BulkPowerActionCommandTest::testSendWithEmptyOptions";d:0.043;s:92:"Tests\Unit\Commands\Server\BulkPowerActionCommandTest::testValidationErrors with data set #0";d:0.043;s:92:"Tests\Unit\Commands\Server\BulkPowerActionCommandTest::testValidationErrors with data set #1";d:0.038;s:92:"Tests\Unit\Commands\Server\BulkPowerActionCommandTest::testValidationErrors with data set #2";d:0.038;s:92:"Tests\Unit\Commands\Server\BulkPowerActionCommandTest::testValidationErrors with data set #3";d:0.038;s:92:"Tests\Unit\Commands\Server\BulkPowerActionCommandTest::testValidationErrors with data set #4";d:0.038;s:72:"Tests\Unit\Commands\User\DeleteUserCommandTest::testCommandWithNoOptions";d:0.065;s:83:"Tests\Unit\Commands\User\DeleteUserCommandTest::testCommandWithInvalidInitialSearch";d:0.047;s:67:"Tests\Unit\Commands\User\DeleteUserCommandTest::testReSearchAbility";d:0.044;s:102:"Tests\Unit\Commands\User\DeleteUserCommandTest::testAnsweringNoToDeletionConfirmationWillNotDeleteUser";d:0.043;s:81:"Tests\Unit\Commands\User\DeleteUserCommandTest::testNoInteractionWithSingleResult";d:0.043;s:84:"Tests\Unit\Commands\User\DeleteUserCommandTest::testNoInteractionWithMultipleResults";d:0.045;s:78:"Tests\Unit\Commands\User\DeleteUserCommandTest::testNoInteractionWithNoResults";d:0.037;s:97:"Tests\Unit\Commands\User\DisableTwoFactorCommandTest::testTwoFactorIsDisabledWhenNoOptionIsPassed";d:0.041;s:95:"Tests\Unit\Commands\User\DisableTwoFactorCommandTest::testTwoFactorIsDisabledWhenOptionIsPassed";d:0.041;s:76:"Tests\Unit\Commands\User\MakeUserCommandTest::testCommandWithNoPassedOptions";d:0.053;s:77:"Tests\Unit\Commands\User\MakeUserCommandTest::testCommandWithNoPasswordOption";d:0.044;s:74:"Tests\Unit\Commands\User\MakeUserCommandTest::testCommandWithOptionsPassed";d:0.043;s:59:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #0";d:0.603;s:59:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #1";d:0.038;s:59:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #2";d:0.038;s:59:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #3";d:0.038;s:59:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #4";d:0.041;s:59:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #5";d:0.037;s:59:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #6";d:0.038;s:59:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #7";d:0.037;s:59:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #8";d:0.037;s:59:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #9";d:0.037;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #10";d:0.038;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #11";d:0.038;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #12";d:0.037;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #13";d:0.039;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #14";d:0.038;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #15";d:0.037;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #16";d:0.037;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #17";d:0.037;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #18";d:0.043;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #19";d:0.037;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #20";d:0.037;s:77:"Tests\Unit\Http\Controllers\Admin\DatabaseControllerTest::testIndexController";d:0.174;s:76:"Tests\Unit\Http\Controllers\Admin\DatabaseControllerTest::testViewController";d:0.047;s:57:"Tests\Unit\Http\Controllers\MailControllerTest::testIndex";d:0.052;s:79:"Tests\Unit\Http\Controllers\Admin\StatisticsControllerTest::testIndexController";d:0.145;s:73:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testIndexController";d:0.054;s:74:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testStatusController";d:0.039;s:96:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testStatusControllerWhenServerNotInstalled";d:0.04;s:95:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testStatusControllerWhenServerIsSuspended";d:0.037;s:103:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testStatusControllerWithServerConnectionException";d:0.038;s:94:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testStatusControllerWithRequestException";d:0.04;s:87:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testIndexWithout2FactorEnabled";d:0.068;s:84:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testIndexWith2FactorEnabled";d:0.042;s:83:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testStore with data set #0";d:0.044;s:83:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testStore with data set #1";d:0.041;s:108:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testStoreWithInvalidTokenException with data set #0";d:0.049;s:108:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testStoreWithInvalidTokenException with data set #1";d:0.043;s:82:"Tests\Unit\Http\Middleware\API\Application\AuthenticateUserTest::testNoUserDefined";d:0.044;s:81:"Tests\Unit\Http\Middleware\API\Application\AuthenticateUserTest::testNonAdminUser";d:0.047;s:78:"Tests\Unit\Http\Middleware\API\Application\AuthenticateUserTest::testAdminUser";d:0.041;s:81:"Tests\Unit\Http\Middleware\API\AuthenticateIPAccessTest::testWithNoIPRestrictions";d:0.043;s:72:"Tests\Unit\Http\Middleware\API\AuthenticateIPAccessTest::testWithValidIP";d:0.044;s:84:"Tests\Unit\Http\Middleware\API\AuthenticateIPAccessTest::testValidIPAgainstCIDRRange";d:0.043;s:74:"Tests\Unit\Http\Middleware\API\AuthenticateIPAccessTest::testWithInvalidIP";d:0.04;s:89:"Tests\Unit\Http\Middleware\API\AuthenticateKeyTest::testMissingBearerTokenThrowsException";d:0.049;s:73:"Tests\Unit\Http\Middleware\API\AuthenticateKeyTest::testInvalidIdentifier";d:0.042;s:66:"Tests\Unit\Http\Middleware\API\AuthenticateKeyTest::testValidToken";d:0.045;s:77:"Tests\Unit\Http\Middleware\API\AuthenticateKeyTest::testValidTokenWithUserKey";d:0.044;s:74:"Tests\Unit\Http\Middleware\API\AuthenticateKeyTest::testAccessWithoutToken";d:0.042;s:81:"Tests\Unit\Http\Middleware\API\AuthenticateKeyTest::testInvalidTokenForIdentifier";d:0.041;s:105:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldContinueIfRouteIsExempted";d:0.05;s:103:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfNoTokenIsProvided";d:0.038;s:99:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfNoNodeIsFound";d:0.035;s:93:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testSuccessfulMiddlewareProcess";d:0.04;s:67:"Tests\Unit\Http\Middleware\API\SetSessionDriverTest::testMiddleware";d:0.039;s:76:"Tests\Unit\Http\Middleware\AdminAuthenticateTest::testAdminsAreAuthenticated";d:0.049;s:89:"Tests\Unit\Http\Middleware\AdminAuthenticateTest::testExceptionIsThrownIfUserDoesNotExist";d:0.043;s:89:"Tests\Unit\Http\Middleware\AdminAuthenticateTest::testExceptionIsThrownIfUserIsNotAnAdmin";d:0.041;s:61:"Tests\Unit\Http\Middleware\AuthenticateTest::testLoggedInUser";d:0.04;s:62:"Tests\Unit\Http\Middleware\AuthenticateTest::testLoggedOutUser";d:0.039;s:76:"Tests\Unit\Http\Middleware\DaemonAuthenticateTest::testValidDaemonConnection";d:0.04;s:81:"Tests\Unit\Http\Middleware\DaemonAuthenticateTest::testIgnoredRouteShouldContinue";d:0.037;s:85:"Tests\Unit\Http\Middleware\DaemonAuthenticateTest::testExceptionThrownIfMissingHeader";d:0.038;s:76:"Tests\Unit\Http\Middleware\LanguageMiddlewareTest::testLanguageIsSetForGuest";d:0.044;s:89:"Tests\Unit\Http\Middleware\LanguageMiddlewareTest::testLanguageIsSetWithAuthenticatedUser";d:0.042;s:64:"Tests\Unit\Http\Middleware\MaintenanceMiddlewareTest::testHandle";d:0.047;s:81:"Tests\Unit\Http\Middleware\MaintenanceMiddlewareTest::testHandleInMaintenanceMode";d:0.047;s:89:"Tests\Unit\Http\Middleware\RedirectIfAuthenticatedTest::testAuthenticatedUserIsRedirected";d:0.047;s:95:"Tests\Unit\Http\Middleware\RedirectIfAuthenticatedTest::testNonAuthenticatedUserIsNotRedirected";d:0.037;s:85:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testRequestMissingUser";d:0.042;s:105:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testRequestOnIgnoredRoute with data set #0";d:0.042;s:105:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testRequestOnIgnoredRoute with data set #1";d:0.045;s:105:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testRequestOnIgnoredRoute with data set #2";d:0.043;s:105:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testRequestOnIgnoredRoute with data set #3";d:0.041;s:105:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testRequestOnIgnoredRoute with data set #4";d:0.04;s:105:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testRequestOnIgnoredRoute with data set #5";d:0.041;s:105:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testRequestOnIgnoredRoute with data set #6";d:0.042;s:105:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testRequestOnIgnoredRoute with data set #7";d:0.041;s:95:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testTwoFactorRequirementDisabled";d:0.042;s:103:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testTwoFactorRequirementWithInvalidValue";d:0.041;s:118:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testTwoFactorEnabledForAdminsAsAdminUserWith2FADisabled";d:0.043;s:117:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testTwoFactorEnabledForAdminsAsAdminUserWith2FAEnabled";d:0.04;s:102:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testTwoFactorEnabledForAdminsAsNonAdmin";d:0.05;s:115:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testTwoFactorEnabledForAllUsersAsUserWith2FADisabled";d:0.042;s:114:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testTwoFactorEnabledForAllUsersAsUserWith2FAEnabled";d:0.041;s:100:"Tests\Unit\Http\Middleware\Server\AccessingValidServerTest::testExceptionIsThrownIfServerIsSuspended";d:0.052;s:103:"Tests\Unit\Http\Middleware\Server\AccessingValidServerTest::testExceptionIsThrownIfServerIsNotInstalled";d:0.042;s:109:"Tests\Unit\Http\Middleware\Server\AccessingValidServerTest::testCorrectErrorPagesAreRendered with data set #0";d:0.038;s:109:"Tests\Unit\Http\Middleware\Server\AccessingValidServerTest::testCorrectErrorPagesAreRendered with data set #1";d:0.039;s:109:"Tests\Unit\Http\Middleware\Server\AccessingValidServerTest::testCorrectErrorPagesAreRendered with data set #2";d:0.039;s:82:"Tests\Unit\Http\Middleware\Server\AccessingValidServerTest::testValidServerProcess";d:0.042;s:85:"Tests\Unit\Http\Middleware\Server\AuthenticateAsSubuserTest::testSuccessfulMiddleware";d:0.05;s:98:"Tests\Unit\Http\Middleware\Server\AuthenticateAsSubuserTest::testExceptionIsThrownIfNoTokenIsFound";d:0.043;s:87:"Tests\Unit\Http\Middleware\Server\DatabaseBelongsToServerTest::testSuccessfulMiddleware";d:0.045;s:107:"Tests\Unit\Http\Middleware\Server\DatabaseBelongsToServerTest::testExceptionIsThrownIfNoDatabaseRecordFound";d:0.043;s:119:"Tests\Unit\Http\Middleware\Server\DatabaseBelongsToServerTest::testExceptionIsThrownIfDatabaseServerDoesNotMatchCurrent";d:0.042;s:87:"Tests\Unit\Http\Middleware\Server\ScheduleBelongsToServerTest::testSuccessfulMiddleware";d:0.051;s:115:"Tests\Unit\Http\Middleware\Server\ScheduleBelongsToServerTest::testExceptionIsThrownIfScheduleDoesNotBelongToServer";d:0.042;s:86:"Tests\Unit\Http\Middleware\Server\SubuserBelongsToServerTest::testSuccessfulMiddleware";d:0.044;s:102:"Tests\Unit\Http\Middleware\Server\SubuserBelongsToServerTest::testSuccessfulMiddlewareWhenPatchRequest";d:0.041;s:104:"Tests\Unit\Http\Middleware\Server\SubuserBelongsToServerTest::testExceptionIsThrownIfUserTriesToEditSelf";d:0.044;s:123:"Tests\Unit\Http\Middleware\Server\SubuserBelongsToServerTest::testExceptionIsThrownIfSubuserServerDoesNotMatchRequestServer";d:0.041;s:101:"Tests\Unit\Http\Middleware\Server\SubuserBelongsToServerTest::testExceptionIsThrownIfNoSubuserIsFound";d:0.041;s:82:"Tests\Unit\Http\Middleware\Api\Application\AuthenticateUserTest::testNoUserDefined";d:0.038;s:81:"Tests\Unit\Http\Middleware\Api\Application\AuthenticateUserTest::testNonAdminUser";d:0.041;s:78:"Tests\Unit\Http\Middleware\Api\Application\AuthenticateUserTest::testAdminUser";d:0.042;s:81:"Tests\Unit\Http\Middleware\Api\AuthenticateIPAccessTest::testWithNoIPRestrictions";d:0.044;s:72:"Tests\Unit\Http\Middleware\Api\AuthenticateIPAccessTest::testWithValidIP";d:0.045;s:84:"Tests\Unit\Http\Middleware\Api\AuthenticateIPAccessTest::testValidIPAgainstCIDRRange";d:0.046;s:74:"Tests\Unit\Http\Middleware\Api\AuthenticateIPAccessTest::testWithInvalidIP";d:0.04;s:89:"Tests\Unit\Http\Middleware\Api\AuthenticateKeyTest::testMissingBearerTokenThrowsException";d:0.051;s:73:"Tests\Unit\Http\Middleware\Api\AuthenticateKeyTest::testInvalidIdentifier";d:0.042;s:66:"Tests\Unit\Http\Middleware\Api\AuthenticateKeyTest::testValidToken";d:0.046;s:77:"Tests\Unit\Http\Middleware\Api\AuthenticateKeyTest::testValidTokenWithUserKey";d:0.042;s:74:"Tests\Unit\Http\Middleware\Api\AuthenticateKeyTest::testAccessWithoutToken";d:0.042;s:81:"Tests\Unit\Http\Middleware\Api\AuthenticateKeyTest::testInvalidTokenForIdentifier";d:0.041;s:67:"Tests\Unit\Http\Middleware\Api\SetSessionDriverTest::testMiddleware";d:0.039;s:108:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfTokenFormatIsIncorrect";d:0.034;s:101:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfTokenIsNotValid";d:0.113;s:100:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfNodeIsNotFound";d:0.038;s:125:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfTokenFormatIsIncorrect with data set #0";d:0.04;s:125:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfTokenFormatIsIncorrect with data set #1";d:0.038;s:125:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfTokenFormatIsIncorrect with data set #2";d:0.038;s:125:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfTokenFormatIsIncorrect with data set #3";d:0.037;s:125:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfTokenFormatIsIncorrect with data set #4";d:0.039;s:125:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfTokenFormatIsIncorrect with data set #5";d:0.042;s:125:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfTokenFormatIsIncorrect with data set #6";d:0.038;s:56:"Tests\Unit\Jobs\Schedule\RunTaskJobTest::testPowerAction";d:0.69;s:58:"Tests\Unit\Jobs\Schedule\RunTaskJobTest::testCommandAction";d:0.041;s:67:"Tests\Unit\Jobs\Schedule\RunTaskJobTest::testNextTaskQueuedIfExists";d:0.04;s:69:"Tests\Unit\Jobs\Schedule\RunTaskJobTest::testInvalidActionPassedToJob";d:0.041;s:83:"Tests\Unit\Jobs\Schedule\RunTaskJobTest::testScheduleMarkedAsDisabledDoesNotProcess";d:0.04;}}} \ No newline at end of file +C:37:"PHPUnit\Runner\DefaultTestResultCache":66049:{a:2:{s:7:"defects";a:153:{s:79:"Tests\Unit\Http\Controllers\Admin\StatisticsControllerTest::testIndexController";i:4;s:73:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testIndexController";i:4;s:74:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testStatusController";i:4;s:96:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testStatusControllerWhenServerNotInstalled";i:4;s:95:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testStatusControllerWhenServerIsSuspended";i:4;s:103:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testStatusControllerWithServerConnectionException";i:4;s:94:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testStatusControllerWithRequestException";i:4;s:87:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testIndexWithout2FactorEnabled";i:4;s:84:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testIndexWith2FactorEnabled";i:4;s:83:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testStore with data set #0";i:4;s:83:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testStore with data set #1";i:4;s:108:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testStoreWithInvalidTokenException with data set #0";i:4;s:108:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testStoreWithInvalidTokenException with data set #1";i:4;s:82:"Tests\Unit\Http\Middleware\API\Application\AuthenticateUserTest::testNoUserDefined";i:6;s:81:"Tests\Unit\Http\Middleware\API\Application\AuthenticateUserTest::testNonAdminUser";i:6;s:74:"Tests\Unit\Http\Middleware\API\AuthenticateIPAccessTest::testWithInvalidIP";i:6;s:73:"Tests\Unit\Http\Middleware\API\AuthenticateKeyTest::testInvalidIdentifier";i:6;s:81:"Tests\Unit\Http\Middleware\API\AuthenticateKeyTest::testInvalidTokenForIdentifier";i:6;s:105:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldContinueIfRouteIsExempted";i:4;s:103:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfNoTokenIsProvided";i:4;s:99:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfNoNodeIsFound";i:4;s:93:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testSuccessfulMiddlewareProcess";i:4;s:89:"Tests\Unit\Http\Middleware\AdminAuthenticateTest::testExceptionIsThrownIfUserDoesNotExist";i:6;s:89:"Tests\Unit\Http\Middleware\AdminAuthenticateTest::testExceptionIsThrownIfUserIsNotAnAdmin";i:6;s:62:"Tests\Unit\Http\Middleware\AuthenticateTest::testLoggedOutUser";i:6;s:76:"Tests\Unit\Http\Middleware\DaemonAuthenticateTest::testValidDaemonConnection";i:4;s:81:"Tests\Unit\Http\Middleware\DaemonAuthenticateTest::testIgnoredRouteShouldContinue";i:4;s:85:"Tests\Unit\Http\Middleware\DaemonAuthenticateTest::testExceptionThrownIfMissingHeader";i:3;s:100:"Tests\Unit\Http\Middleware\Server\AccessingValidServerTest::testExceptionIsThrownIfServerIsSuspended";i:6;s:103:"Tests\Unit\Http\Middleware\Server\AccessingValidServerTest::testExceptionIsThrownIfServerIsNotInstalled";i:6;s:98:"Tests\Unit\Http\Middleware\Server\AuthenticateAsSubuserTest::testExceptionIsThrownIfNoTokenIsFound";i:6;s:107:"Tests\Unit\Http\Middleware\Server\DatabaseBelongsToServerTest::testExceptionIsThrownIfNoDatabaseRecordFound";i:6;s:119:"Tests\Unit\Http\Middleware\Server\DatabaseBelongsToServerTest::testExceptionIsThrownIfDatabaseServerDoesNotMatchCurrent";i:6;s:115:"Tests\Unit\Http\Middleware\Server\ScheduleBelongsToServerTest::testExceptionIsThrownIfScheduleDoesNotBelongToServer";i:6;s:123:"Tests\Unit\Http\Middleware\Server\SubuserBelongsToServerTest::testExceptionIsThrownIfSubuserServerDoesNotMatchRequestServer";i:6;s:101:"Tests\Unit\Http\Middleware\Server\SubuserBelongsToServerTest::testExceptionIsThrownIfNoSubuserIsFound";i:6;s:100:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfNodeIsNotFound";i:5;s:56:"Tests\Unit\Jobs\Schedule\RunTaskJobTest::testPowerAction";i:4;s:58:"Tests\Unit\Jobs\Schedule\RunTaskJobTest::testCommandAction";i:4;s:67:"Tests\Unit\Jobs\Schedule\RunTaskJobTest::testNextTaskQueuedIfExists";i:4;s:69:"Tests\Unit\Jobs\Schedule\RunTaskJobTest::testInvalidActionPassedToJob";i:6;s:83:"Tests\Unit\Jobs\Schedule\RunTaskJobTest::testScheduleMarkedAsDisabledDoesNotProcess";i:4;s:100:"Tests\Unit\Services\Allocations\AllocationDeletionServiceTest::testExceptionThrownIfAssignedToServer";i:6;s:96:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testCIDRNotatedIPAddressOutsideRangeLimit";i:6;s:92:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testAllocationWithPortsExceedingLimit";i:6;s:78:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testInvalidPortProvided";i:6;s:105:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testPortRangeOutsideOfRangeLimits with data set #0";i:6;s:105:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testPortRangeOutsideOfRangeLimits with data set #1";i:6;s:105:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testPortRangeOutsideOfRangeLimits with data set #2";i:6;s:105:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testPortRangeOutsideOfRangeLimits with data set #3";i:6;s:105:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testPortRangeOutsideOfRangeLimits with data set #4";i:6;s:105:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testPortRangeOutsideOfRangeLimits with data set #5";i:6;s:105:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testPortRangeOutsideOfRangeLimits with data set #6";i:6;s:105:"Tests\Unit\Services\Allocations\SetDefaultAllocationServiceTest::testAllocationIsUpdated with data set #0";i:4;s:105:"Tests\Unit\Services\Allocations\SetDefaultAllocationServiceTest::testAllocationIsUpdated with data set #1";i:4;s:114:"Tests\Unit\Services\Allocations\SetDefaultAllocationServiceTest::testAllocationNotBelongingToServerThrowsException";i:3;s:101:"Tests\Unit\Services\Allocations\SetDefaultAllocationServiceTest::testExceptionThrownByGuzzleIsHandled";i:4;s:105:"Tests\Unit\Services\DaemonKeys\DaemonKeyProviderServiceTest::testExceptionIsThrownIfUserDoesNotDeserveKey";i:6;s:95:"Tests\Unit\Services\DaemonKeys\RevokeMultipleDaemonKeysServiceTest::testSuccessfulKeyRevocation";i:4;s:110:"Tests\Unit\Services\DaemonKeys\RevokeMultipleDaemonKeysServiceTest::testExceptionThrownFromDaemonCallIsHandled";i:3;s:107:"Tests\Unit\Services\DaemonKeys\RevokeMultipleDaemonKeysServiceTest::testIgnoredExceptionsAreHandledProperly";i:4;s:80:"Tests\Unit\Services\Databases\DatabasePasswordServiceTest::testPasswordIsChanged";i:4;s:102:"Tests\Unit\Services\Databases\DeployServerDatabaseServiceTest::testNonRandomFoundHost with data set #0";i:4;s:102:"Tests\Unit\Services\Databases\DeployServerDatabaseServiceTest::testNonRandomFoundHost with data set #1";i:4;s:82:"Tests\Unit\Services\Databases\DeployServerDatabaseServiceTest::testNonRandomNoHost";i:6;s:82:"Tests\Unit\Services\Databases\DeployServerDatabaseServiceTest::testRandomFoundHost";i:4;s:79:"Tests\Unit\Services\Databases\DeployServerDatabaseServiceTest::testRandomNoHost";i:6;s:107:"Tests\Unit\Services\Databases\DeployServerDatabaseServiceTest::testServerOverDatabaseLimit with data set #0";i:3;s:107:"Tests\Unit\Services\Databases\DeployServerDatabaseServiceTest::testServerOverDatabaseLimit with data set #1";i:3;s:84:"Tests\Unit\Services\Databases\DeployServerDatabaseServiceTest::testFeatureNotEnabled";i:3;s:80:"Tests\Unit\Services\Eggs\EggConfigurationServiceTest::testCorrectArrayIsReturned";i:4;s:100:"Tests\Unit\Services\Eggs\EggConfigurationServiceTest::testFunctionHandlesIntegerPassedInPlaceOfModel";i:4;s:146:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #0";i:6;s:146:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #1";i:6;s:146:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #2";i:6;s:146:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #3";i:6;s:146:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #4";i:6;s:146:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #5";i:6;s:146:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #6";i:6;s:146:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #7";i:6;s:146:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #8";i:6;s:107:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testInvalidValidationRulesResultInException";i:6;s:106:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testExceptionNotCausedByBadRuleIsNotCaught";i:6;s:144:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #0";i:6;s:144:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #1";i:6;s:144:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #2";i:6;s:144:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #3";i:6;s:144:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #4";i:6;s:144:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #5";i:6;s:144:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #6";i:6;s:144:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #7";i:6;s:144:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #8";i:6;s:105:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testInvalidValidationRulesResultInException";i:6;s:104:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testExceptionNotCausedByBadRuleIsNotCaught";i:6;s:82:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testPanelVersionIsReturned";i:4;s:103:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testPanelVersionIsReturnedAsErrorIfNoKeyIsFound";i:4;s:83:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testDaemonVersionIsReturned";i:4;s:104:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testDaemonVersionIsReturnedAsErrorIfNoKeyIsFound";i:4;s:80:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testDiscordUrlIsReturned";i:4;s:130:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testCorrectBooleanValueIsReturnedWhenCheckingPanelVersion with data set #0";i:4;s:130:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testCorrectBooleanValueIsReturnedWhenCheckingPanelVersion with data set #1";i:4;s:130:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testCorrectBooleanValueIsReturnedWhenCheckingPanelVersion with data set #2";i:4;s:131:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testCorrectBooleanValueIsReturnedWhenCheckingDaemonVersion with data set #0";i:4;s:131:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testCorrectBooleanValueIsReturnedWhenCheckingDaemonVersion with data set #1";i:4;s:131:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testCorrectBooleanValueIsReturnedWhenCheckingDaemonVersion with data set #2";i:4;s:94:"Tests\Unit\Services\Nodes\NodeCreationServiceTest::testNodeIsCreatedAndDaemonSecretIsGenerated";i:4;s:98:"Tests\Unit\Services\Nodes\NodeDeletionServiceTest::testExceptionIsThrownIfServersAreAttachedToNode";i:6;s:88:"Tests\Unit\Services\Nodes\NodeUpdateServiceTest::testNodeIsUpdatedAndDaemonSecretIsReset";i:4;s:93:"Tests\Unit\Services\Nodes\NodeUpdateServiceTest::testNodeIsUpdatedAndDaemonSecretIsNotChanged";i:4;s:81:"Tests\Unit\Services\Nodes\NodeUpdateServiceTest::testExceptionRelatedToConnection";i:3;s:84:"Tests\Unit\Services\Nodes\NodeUpdateServiceTest::testExceptionNotRelatedToConnection";i:3;s:97:"Tests\Unit\Services\Packs\ExportPackServiceTest::testExceptionIsThrownIfZipArchiveCannotBeCreated";i:6;s:102:"Tests\Unit\Services\Servers\ReinstallServerServiceTest::testServerShouldBeReinstalledWhenModelIsPassed";i:4;s:105:"Tests\Unit\Services\Servers\ReinstallServerServiceTest::testServerShouldBeReinstalledWhenServerIdIsPassed";i:4;s:114:"Tests\Unit\Services\Servers\ReinstallServerServiceTest::testExceptionThrownByGuzzleShouldBeReRenderedAsDisplayable";i:4;s:121:"Tests\Unit\Services\Servers\ReinstallServerServiceTest::testExceptionNotThrownByGuzzleShouldNotBeTransformedToDisplayable";i:4;s:99:"Tests\Unit\Services\Servers\ServerConfigurationStructureServiceTest::testCorrectStructureIsReturned";i:3;s:116:"Tests\Unit\Services\Servers\ServerCreationServiceTest::testCreateShouldHitAllOfTheNecessaryServicesAndStoreTheServer";i:4;s:75:"Tests\Unit\Services\Servers\ServerCreationServiceTest::testDataIsAutoFilled";i:4;s:79:"Tests\Unit\Services\Servers\ServerCreationServiceTest::testAutoDeploymentObject";i:4;s:99:"Tests\Unit\Services\Servers\ServerCreationServiceTest::testExceptionShouldBeThrownIfTheRequestFails";i:3;s:81:"Tests\Unit\Services\Servers\ServerDeletionServiceTest::testForceParameterCanBeSet";i:4;s:89:"Tests\Unit\Services\Servers\ServerDeletionServiceTest::testServerCanBeDeletedWithoutForce";i:4;s:113:"Tests\Unit\Services\Servers\ServerDeletionServiceTest::testServerShouldBeDeletedEvenWhenFailureOccursIfForceIsSet";i:4;s:120:"Tests\Unit\Services\Servers\ServerDeletionServiceTest::testExceptionShouldBeThrownIfDaemonReturnsAnErrorAndForceIsNotSet";i:3;s:91:"Tests\Unit\Services\Servers\StartupModificationServiceTest::testStartupModifiedAsNormalUser";i:4;s:94:"Tests\Unit\Services\Servers\StartupModificationServiceTest::testStartupModificationAsAdminUser";i:4;s:105:"Tests\Unit\Services\Servers\SuspensionServiceTest::testFunctionShouldAcceptAnIntegerInPlaceOfAServerModel";i:4;s:98:"Tests\Unit\Services\Servers\SuspensionServiceTest::testServerShouldBeSuspendedWhenNoActionIsPassed";i:4;s:107:"Tests\Unit\Services\Servers\SuspensionServiceTest::testServerShouldBeUnsuspendedWhenUnsuspendActionIsPassed";i:4;s:123:"Tests\Unit\Services\Servers\SuspensionServiceTest::testNoActionShouldHappenIfServerIsAlreadyUnsuspendedAndActionIsUnsuspend";i:4;s:119:"Tests\Unit\Services\Servers\SuspensionServiceTest::testNoActionShouldHappenIfServerIsAlreadySuspendedAndActionIsSuspend";i:4;s:119:"Tests\Unit\Services\Servers\SuspensionServiceTest::testExceptionThrownByGuzzleShouldBeCaughtAndTransformedToDisplayable";i:4;s:96:"Tests\Unit\Services\Servers\SuspensionServiceTest::testExceptionShouldBeThrownIfActionIsNotValid";i:4;s:95:"Tests\Unit\Services\Subusers\PermissionCreationServiceTest::testPermissionsAreAssignedCorrectly";i:4;s:87:"Tests\Unit\Services\Subusers\SubuserCreationServiceTest::testAccountIsCreatedForNewUser";i:4;s:93:"Tests\Unit\Services\Subusers\SubuserCreationServiceTest::testExistingUserCanBeAddedAsASubuser";i:4;s:97:"Tests\Unit\Services\Subusers\SubuserCreationServiceTest::testExceptionIsThrownIfUserIsServerOwner";i:4;s:101:"Tests\Unit\Services\Subusers\SubuserCreationServiceTest::testExceptionIsThrownIfUserIsAlreadyASubuser";i:4;s:80:"Tests\Unit\Services\Subusers\SubuserUpdateServiceTest::testPermissionsAreUpdated";i:4;s:99:"Tests\Unit\Services\Subusers\SubuserUpdateServiceTest::testExceptionIsThrownIfDaemonConnectionFails";i:4;s:83:"Tests\Unit\Services\Users\ToggleTwoFactorServiceTest::testTwoFactorIsEnabledForUser";i:4;s:77:"Tests\Unit\Services\Users\ToggleTwoFactorServiceTest::testTwoFactorIsDisabled";i:4;s:89:"Tests\Unit\Services\Users\ToggleTwoFactorServiceTest::testTwoFactorRemainsDisabledForUser";i:4;s:91:"Tests\Unit\Services\Users\ToggleTwoFactorServiceTest::testExceptionIsThrownIfTokenIsInvalid";i:3;s:101:"Tests\Unit\Services\Users\UserDeletionServiceTest::testExceptionIsThrownIfServersAreAttachedToAccount";i:6;s:119:"Tests\Unit\Services\Users\UserUpdateServiceTest::testUpdateUserWithoutTouchingHasherIfNoPasswordPassed with data set #0";i:4;s:119:"Tests\Unit\Services\Users\UserUpdateServiceTest::testUpdateUserWithoutTouchingHasherIfNoPasswordPassed with data set #1";i:4;s:119:"Tests\Unit\Services\Users\UserUpdateServiceTest::testUpdateUserWithoutTouchingHasherIfNoPasswordPassed with data set #2";i:4;s:119:"Tests\Unit\Services\Users\UserUpdateServiceTest::testUpdateUserWithoutTouchingHasherIfNoPasswordPassed with data set #3";i:4;s:88:"Tests\Unit\Services\Users\UserUpdateServiceTest::testUpdateUserAndHashPasswordIfProvided";i:4;s:90:"Tests\Unit\Services\Users\UserUpdateServiceTest::testAdministrativeUserRevokingAdminStatus";i:4;s:89:"Tests\Unit\Services\Users\UserUpdateServiceTest::testNormalUserShouldNotRevokeAdminStatus";i:4;}s:5:"times";a:438:{s:81:"Tests\Unit\Commands\Environment\EmailSettingsCommandTest::testSmtpDriverSelection";d:0.19;s:98:"Tests\Unit\Commands\Environment\EmailSettingsCommandTest::testSmtpDriverSelectionWithOptionsPassed";d:0.037;s:84:"Tests\Unit\Commands\Environment\EmailSettingsCommandTest::testPHPMailDriverSelection";d:0.051;s:84:"Tests\Unit\Commands\Environment\EmailSettingsCommandTest::testMailgunDriverSelection";d:0.049;s:101:"Tests\Unit\Commands\Environment\EmailSettingsCommandTest::testMailgunDriverSelectionWithOptionsPassed";d:0.033;s:85:"Tests\Unit\Commands\Environment\EmailSettingsCommandTest::testMandrillDriverSelection";d:0.049;s:102:"Tests\Unit\Commands\Environment\EmailSettingsCommandTest::testMandrillDriverSelectionWithOptionsPassed";d:0.034;s:85:"Tests\Unit\Commands\Environment\EmailSettingsCommandTest::testPostmarkDriverSelection";d:0.06;s:102:"Tests\Unit\Commands\Environment\EmailSettingsCommandTest::testPostmarkDriverSelectionWithOptionsPassed";d:0.033;s:77:"Tests\Unit\Commands\Location\DeleteLocationCommandTest::testLocationIsDeleted";d:0.053;s:93:"Tests\Unit\Commands\Location\DeleteLocationCommandTest::testLocationIsDeletedIfPassedInOption";d:0.035;s:106:"Tests\Unit\Commands\Location\DeleteLocationCommandTest::testInteractiveEnvironmentAllowsReAttemptingSearch";d:0.06;s:115:"Tests\Unit\Commands\Location\DeleteLocationCommandTest::testNonInteractiveEnvironmentThrowsErrorIfNoLocationIsFound";d:0.036;s:94:"Tests\Unit\Commands\Location\MakeLocationCommandTest::testLocationIsCreatedWithNoOptionsPassed";d:0.038;s:95:"Tests\Unit\Commands\Location\MakeLocationCommandTest::testLocationIsCreatedWhenOptionsArePassed";d:0.037;s:109:"Tests\Unit\Commands\Maintenance\CleanServiceBackupFilesCommandTest::testCommandCleansFilesMoreThan5MinutesOld";d:0.044;s:114:"Tests\Unit\Commands\Maintenance\CleanServiceBackupFilesCommandTest::testCommandDoesNotCleanFileLessThan5MinutesOld";d:0.043;s:77:"Tests\Unit\Commands\Schedule\ProcessRunnableCommandTest::testScheduleIsQueued";d:0.066;s:94:"Tests\Unit\Commands\Schedule\ProcessRunnableCommandTest::testScheduleWithNoTasksIsNotProcessed";d:0.046;s:127:"Tests\Unit\Commands\Schedule\ProcessRunnableCommandTest::testScheduleWithTasksObjectThatIsNotInstanceOfCollectionIsNotProcessed";d:0.042;s:69:"Tests\Unit\Commands\Server\BulkPowerActionCommandTest::testSendAction";d:0.148;s:74:"Tests\Unit\Commands\Server\BulkPowerActionCommandTest::testSendWithFilters";d:0.048;s:79:"Tests\Unit\Commands\Server\BulkPowerActionCommandTest::testSendWithEmptyOptions";d:0.041;s:92:"Tests\Unit\Commands\Server\BulkPowerActionCommandTest::testValidationErrors with data set #0";d:0.039;s:92:"Tests\Unit\Commands\Server\BulkPowerActionCommandTest::testValidationErrors with data set #1";d:0.036;s:92:"Tests\Unit\Commands\Server\BulkPowerActionCommandTest::testValidationErrors with data set #2";d:0.042;s:92:"Tests\Unit\Commands\Server\BulkPowerActionCommandTest::testValidationErrors with data set #3";d:0.035;s:92:"Tests\Unit\Commands\Server\BulkPowerActionCommandTest::testValidationErrors with data set #4";d:0.037;s:72:"Tests\Unit\Commands\User\DeleteUserCommandTest::testCommandWithNoOptions";d:0.061;s:83:"Tests\Unit\Commands\User\DeleteUserCommandTest::testCommandWithInvalidInitialSearch";d:0.038;s:67:"Tests\Unit\Commands\User\DeleteUserCommandTest::testReSearchAbility";d:0.04;s:102:"Tests\Unit\Commands\User\DeleteUserCommandTest::testAnsweringNoToDeletionConfirmationWillNotDeleteUser";d:0.039;s:81:"Tests\Unit\Commands\User\DeleteUserCommandTest::testNoInteractionWithSingleResult";d:0.038;s:84:"Tests\Unit\Commands\User\DeleteUserCommandTest::testNoInteractionWithMultipleResults";d:0.04;s:78:"Tests\Unit\Commands\User\DeleteUserCommandTest::testNoInteractionWithNoResults";d:0.035;s:97:"Tests\Unit\Commands\User\DisableTwoFactorCommandTest::testTwoFactorIsDisabledWhenNoOptionIsPassed";d:0.04;s:95:"Tests\Unit\Commands\User\DisableTwoFactorCommandTest::testTwoFactorIsDisabledWhenOptionIsPassed";d:0.039;s:76:"Tests\Unit\Commands\User\MakeUserCommandTest::testCommandWithNoPassedOptions";d:0.055;s:77:"Tests\Unit\Commands\User\MakeUserCommandTest::testCommandWithNoPasswordOption";d:0.04;s:74:"Tests\Unit\Commands\User\MakeUserCommandTest::testCommandWithOptionsPassed";d:0.039;s:59:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #0";d:0.043;s:59:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #1";d:0.035;s:59:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #2";d:0.035;s:59:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #3";d:0.034;s:59:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #4";d:0.034;s:59:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #5";d:0.035;s:59:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #6";d:0.036;s:59:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #7";d:0.036;s:59:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #8";d:0.035;s:59:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #9";d:0.036;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #10";d:0.038;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #11";d:0.035;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #12";d:0.034;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #13";d:0.036;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #14";d:0.036;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #15";d:0.035;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #16";d:0.036;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #17";d:0.034;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #18";d:0.035;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #19";d:0.046;s:60:"Tests\Unit\Helpers\IsDigitTest::testHelper with data set #20";d:0.037;s:77:"Tests\Unit\Http\Controllers\Admin\DatabaseControllerTest::testIndexController";d:0.133;s:76:"Tests\Unit\Http\Controllers\Admin\DatabaseControllerTest::testViewController";d:0.034;s:57:"Tests\Unit\Http\Controllers\MailControllerTest::testIndex";d:0.041;s:79:"Tests\Unit\Http\Controllers\Admin\StatisticsControllerTest::testIndexController";d:0.145;s:73:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testIndexController";d:0.054;s:74:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testStatusController";d:0.039;s:96:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testStatusControllerWhenServerNotInstalled";d:0.04;s:95:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testStatusControllerWhenServerIsSuspended";d:0.037;s:103:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testStatusControllerWithServerConnectionException";d:0.038;s:94:"Tests\Unit\Http\Controllers\Base\IndexControllerTest::testStatusControllerWithRequestException";d:0.04;s:87:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testIndexWithout2FactorEnabled";d:0.068;s:84:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testIndexWith2FactorEnabled";d:0.042;s:83:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testStore with data set #0";d:0.044;s:83:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testStore with data set #1";d:0.041;s:108:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testStoreWithInvalidTokenException with data set #0";d:0.049;s:108:"Tests\Unit\Http\Controllers\Base\SecurityControllerTest::testStoreWithInvalidTokenException with data set #1";d:0.043;s:82:"Tests\Unit\Http\Middleware\API\Application\AuthenticateUserTest::testNoUserDefined";d:0.044;s:81:"Tests\Unit\Http\Middleware\API\Application\AuthenticateUserTest::testNonAdminUser";d:0.047;s:78:"Tests\Unit\Http\Middleware\API\Application\AuthenticateUserTest::testAdminUser";d:0.041;s:81:"Tests\Unit\Http\Middleware\API\AuthenticateIPAccessTest::testWithNoIPRestrictions";d:0.043;s:72:"Tests\Unit\Http\Middleware\API\AuthenticateIPAccessTest::testWithValidIP";d:0.044;s:84:"Tests\Unit\Http\Middleware\API\AuthenticateIPAccessTest::testValidIPAgainstCIDRRange";d:0.043;s:74:"Tests\Unit\Http\Middleware\API\AuthenticateIPAccessTest::testWithInvalidIP";d:0.04;s:89:"Tests\Unit\Http\Middleware\API\AuthenticateKeyTest::testMissingBearerTokenThrowsException";d:0.049;s:73:"Tests\Unit\Http\Middleware\API\AuthenticateKeyTest::testInvalidIdentifier";d:0.042;s:66:"Tests\Unit\Http\Middleware\API\AuthenticateKeyTest::testValidToken";d:0.045;s:77:"Tests\Unit\Http\Middleware\API\AuthenticateKeyTest::testValidTokenWithUserKey";d:0.044;s:74:"Tests\Unit\Http\Middleware\API\AuthenticateKeyTest::testAccessWithoutToken";d:0.042;s:81:"Tests\Unit\Http\Middleware\API\AuthenticateKeyTest::testInvalidTokenForIdentifier";d:0.041;s:105:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldContinueIfRouteIsExempted";d:0.045;s:103:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfNoTokenIsProvided";d:0.035;s:99:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfNoNodeIsFound";d:0.035;s:93:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testSuccessfulMiddlewareProcess";d:0.037;s:67:"Tests\Unit\Http\Middleware\API\SetSessionDriverTest::testMiddleware";d:0.039;s:76:"Tests\Unit\Http\Middleware\AdminAuthenticateTest::testAdminsAreAuthenticated";d:0.035;s:89:"Tests\Unit\Http\Middleware\AdminAuthenticateTest::testExceptionIsThrownIfUserDoesNotExist";d:0.04;s:89:"Tests\Unit\Http\Middleware\AdminAuthenticateTest::testExceptionIsThrownIfUserIsNotAnAdmin";d:0.035;s:61:"Tests\Unit\Http\Middleware\AuthenticateTest::testLoggedInUser";d:0.039;s:62:"Tests\Unit\Http\Middleware\AuthenticateTest::testLoggedOutUser";d:0.039;s:76:"Tests\Unit\Http\Middleware\DaemonAuthenticateTest::testValidDaemonConnection";d:0.04;s:81:"Tests\Unit\Http\Middleware\DaemonAuthenticateTest::testIgnoredRouteShouldContinue";d:0.037;s:85:"Tests\Unit\Http\Middleware\DaemonAuthenticateTest::testExceptionThrownIfMissingHeader";d:0.038;s:76:"Tests\Unit\Http\Middleware\LanguageMiddlewareTest::testLanguageIsSetForGuest";d:0.043;s:89:"Tests\Unit\Http\Middleware\LanguageMiddlewareTest::testLanguageIsSetWithAuthenticatedUser";d:0.042;s:64:"Tests\Unit\Http\Middleware\MaintenanceMiddlewareTest::testHandle";d:0.047;s:81:"Tests\Unit\Http\Middleware\MaintenanceMiddlewareTest::testHandleInMaintenanceMode";d:0.05;s:89:"Tests\Unit\Http\Middleware\RedirectIfAuthenticatedTest::testAuthenticatedUserIsRedirected";d:0.05;s:95:"Tests\Unit\Http\Middleware\RedirectIfAuthenticatedTest::testNonAuthenticatedUserIsNotRedirected";d:0.037;s:85:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testRequestMissingUser";d:0.043;s:105:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testRequestOnIgnoredRoute with data set #0";d:0.042;s:105:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testRequestOnIgnoredRoute with data set #1";d:0.041;s:105:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testRequestOnIgnoredRoute with data set #2";d:0.041;s:105:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testRequestOnIgnoredRoute with data set #3";d:0.041;s:105:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testRequestOnIgnoredRoute with data set #4";d:0.042;s:105:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testRequestOnIgnoredRoute with data set #5";d:0.042;s:105:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testRequestOnIgnoredRoute with data set #6";d:0.041;s:105:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testRequestOnIgnoredRoute with data set #7";d:0.042;s:95:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testTwoFactorRequirementDisabled";d:0.042;s:103:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testTwoFactorRequirementWithInvalidValue";d:0.042;s:118:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testTwoFactorEnabledForAdminsAsAdminUserWith2FADisabled";d:0.045;s:117:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testTwoFactorEnabledForAdminsAsAdminUserWith2FAEnabled";d:0.041;s:102:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testTwoFactorEnabledForAdminsAsNonAdmin";d:0.04;s:115:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testTwoFactorEnabledForAllUsersAsUserWith2FADisabled";d:0.042;s:114:"Tests\Unit\Http\Middleware\RequireTwoFactorAuthenticationTest::testTwoFactorEnabledForAllUsersAsUserWith2FAEnabled";d:0.041;s:100:"Tests\Unit\Http\Middleware\Server\AccessingValidServerTest::testExceptionIsThrownIfServerIsSuspended";d:0.052;s:103:"Tests\Unit\Http\Middleware\Server\AccessingValidServerTest::testExceptionIsThrownIfServerIsNotInstalled";d:0.043;s:109:"Tests\Unit\Http\Middleware\Server\AccessingValidServerTest::testCorrectErrorPagesAreRendered with data set #0";d:0.038;s:109:"Tests\Unit\Http\Middleware\Server\AccessingValidServerTest::testCorrectErrorPagesAreRendered with data set #1";d:0.037;s:109:"Tests\Unit\Http\Middleware\Server\AccessingValidServerTest::testCorrectErrorPagesAreRendered with data set #2";d:0.037;s:82:"Tests\Unit\Http\Middleware\Server\AccessingValidServerTest::testValidServerProcess";d:0.041;s:85:"Tests\Unit\Http\Middleware\Server\AuthenticateAsSubuserTest::testSuccessfulMiddleware";d:0.053;s:98:"Tests\Unit\Http\Middleware\Server\AuthenticateAsSubuserTest::testExceptionIsThrownIfNoTokenIsFound";d:0.042;s:87:"Tests\Unit\Http\Middleware\Server\DatabaseBelongsToServerTest::testSuccessfulMiddleware";d:0.045;s:107:"Tests\Unit\Http\Middleware\Server\DatabaseBelongsToServerTest::testExceptionIsThrownIfNoDatabaseRecordFound";d:0.043;s:119:"Tests\Unit\Http\Middleware\Server\DatabaseBelongsToServerTest::testExceptionIsThrownIfDatabaseServerDoesNotMatchCurrent";d:0.042;s:87:"Tests\Unit\Http\Middleware\Server\ScheduleBelongsToServerTest::testSuccessfulMiddleware";d:0.051;s:115:"Tests\Unit\Http\Middleware\Server\ScheduleBelongsToServerTest::testExceptionIsThrownIfScheduleDoesNotBelongToServer";d:0.042;s:86:"Tests\Unit\Http\Middleware\Server\SubuserBelongsToServerTest::testSuccessfulMiddleware";d:0.044;s:102:"Tests\Unit\Http\Middleware\Server\SubuserBelongsToServerTest::testSuccessfulMiddlewareWhenPatchRequest";d:0.041;s:104:"Tests\Unit\Http\Middleware\Server\SubuserBelongsToServerTest::testExceptionIsThrownIfUserTriesToEditSelf";d:0.044;s:123:"Tests\Unit\Http\Middleware\Server\SubuserBelongsToServerTest::testExceptionIsThrownIfSubuserServerDoesNotMatchRequestServer";d:0.041;s:101:"Tests\Unit\Http\Middleware\Server\SubuserBelongsToServerTest::testExceptionIsThrownIfNoSubuserIsFound";d:0.041;s:82:"Tests\Unit\Http\Middleware\Api\Application\AuthenticateUserTest::testNoUserDefined";d:0.034;s:81:"Tests\Unit\Http\Middleware\Api\Application\AuthenticateUserTest::testNonAdminUser";d:0.037;s:78:"Tests\Unit\Http\Middleware\Api\Application\AuthenticateUserTest::testAdminUser";d:0.036;s:81:"Tests\Unit\Http\Middleware\Api\AuthenticateIPAccessTest::testWithNoIPRestrictions";d:0.038;s:72:"Tests\Unit\Http\Middleware\Api\AuthenticateIPAccessTest::testWithValidIP";d:0.044;s:84:"Tests\Unit\Http\Middleware\Api\AuthenticateIPAccessTest::testValidIPAgainstCIDRRange";d:0.042;s:74:"Tests\Unit\Http\Middleware\Api\AuthenticateIPAccessTest::testWithInvalidIP";d:0.037;s:89:"Tests\Unit\Http\Middleware\Api\AuthenticateKeyTest::testMissingBearerTokenThrowsException";d:0.046;s:73:"Tests\Unit\Http\Middleware\Api\AuthenticateKeyTest::testInvalidIdentifier";d:0.041;s:66:"Tests\Unit\Http\Middleware\Api\AuthenticateKeyTest::testValidToken";d:0.043;s:77:"Tests\Unit\Http\Middleware\Api\AuthenticateKeyTest::testValidTokenWithUserKey";d:0.038;s:74:"Tests\Unit\Http\Middleware\Api\AuthenticateKeyTest::testAccessWithoutToken";d:0.038;s:81:"Tests\Unit\Http\Middleware\Api\AuthenticateKeyTest::testInvalidTokenForIdentifier";d:0.036;s:67:"Tests\Unit\Http\Middleware\Api\SetSessionDriverTest::testMiddleware";d:0.04;s:108:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfTokenFormatIsIncorrect";d:0.034;s:101:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfTokenIsNotValid";d:0.129;s:100:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfNodeIsNotFound";d:0.035;s:125:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfTokenFormatIsIncorrect with data set #0";d:0.035;s:125:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfTokenFormatIsIncorrect with data set #1";d:0.034;s:125:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfTokenFormatIsIncorrect with data set #2";d:0.034;s:125:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfTokenFormatIsIncorrect with data set #3";d:0.036;s:125:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfTokenFormatIsIncorrect with data set #4";d:0.037;s:125:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfTokenFormatIsIncorrect with data set #5";d:0.038;s:125:"Tests\Unit\Http\Middleware\Api\Daemon\DaemonAuthenticateTest::testResponseShouldFailIfTokenFormatIsIncorrect with data set #6";d:0.034;s:56:"Tests\Unit\Jobs\Schedule\RunTaskJobTest::testPowerAction";d:0.072;s:58:"Tests\Unit\Jobs\Schedule\RunTaskJobTest::testCommandAction";d:0.042;s:67:"Tests\Unit\Jobs\Schedule\RunTaskJobTest::testNextTaskQueuedIfExists";d:0.038;s:69:"Tests\Unit\Jobs\Schedule\RunTaskJobTest::testInvalidActionPassedToJob";d:0.043;s:83:"Tests\Unit\Jobs\Schedule\RunTaskJobTest::testScheduleMarkedAsDisabledDoesNotProcess";d:0.037;s:51:"Tests\Unit\Rules\UsernameTest::testRuleIsStringable";d:0.534;s:66:"Tests\Unit\Rules\UsernameTest::testValidUsernames with data set #0";d:0.034;s:66:"Tests\Unit\Rules\UsernameTest::testValidUsernames with data set #1";d:0.032;s:66:"Tests\Unit\Rules\UsernameTest::testValidUsernames with data set #2";d:0.032;s:66:"Tests\Unit\Rules\UsernameTest::testValidUsernames with data set #3";d:0.032;s:66:"Tests\Unit\Rules\UsernameTest::testValidUsernames with data set #4";d:0.032;s:66:"Tests\Unit\Rules\UsernameTest::testValidUsernames with data set #5";d:0.033;s:66:"Tests\Unit\Rules\UsernameTest::testValidUsernames with data set #6";d:0.033;s:68:"Tests\Unit\Rules\UsernameTest::testInvalidUsernames with data set #0";d:0.032;s:68:"Tests\Unit\Rules\UsernameTest::testInvalidUsernames with data set #1";d:0.032;s:68:"Tests\Unit\Rules\UsernameTest::testInvalidUsernames with data set #2";d:0.033;s:68:"Tests\Unit\Rules\UsernameTest::testInvalidUsernames with data set #3";d:0.032;s:68:"Tests\Unit\Rules\UsernameTest::testInvalidUsernames with data set #4";d:0.034;s:68:"Tests\Unit\Rules\UsernameTest::testInvalidUsernames with data set #5";d:0.032;s:68:"Tests\Unit\Rules\UsernameTest::testInvalidUsernames with data set #6";d:0.032;s:68:"Tests\Unit\Rules\UsernameTest::testInvalidUsernames with data set #7";d:0.032;s:68:"Tests\Unit\Rules\UsernameTest::testInvalidUsernames with data set #8";d:0.032;s:68:"Tests\Unit\Rules\UsernameTest::testInvalidUsernames with data set #9";d:0.033;s:69:"Tests\Unit\Rules\UsernameTest::testInvalidUsernames with data set #10";d:0.035;s:69:"Tests\Unit\Rules\UsernameTest::testInvalidUsernames with data set #11";d:0.032;s:74:"Tests\Unit\Services\Acl\Api\AdminAclTest::testPermissions with data set #0";d:0.577;s:74:"Tests\Unit\Services\Acl\Api\AdminAclTest::testPermissions with data set #1";d:0.037;s:74:"Tests\Unit\Services\Acl\Api\AdminAclTest::testPermissions with data set #2";d:0.036;s:74:"Tests\Unit\Services\Acl\Api\AdminAclTest::testPermissions with data set #3";d:0.037;s:74:"Tests\Unit\Services\Acl\Api\AdminAclTest::testPermissions with data set #4";d:0.036;s:74:"Tests\Unit\Services\Acl\Api\AdminAclTest::testPermissions with data set #5";d:0.036;s:74:"Tests\Unit\Services\Acl\Api\AdminAclTest::testPermissions with data set #6";d:0.036;s:51:"Tests\Unit\Services\Acl\Api\AdminAclTest::testCheck";d:0.089;s:86:"Tests\Unit\Services\Allocations\AllocationDeletionServiceTest::testAllocationIsDeleted";d:0.722;s:100:"Tests\Unit\Services\Allocations\AllocationDeletionServiceTest::testExceptionThrownIfAssignedToServer";d:0.053;s:90:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testIndividualIpAddressWithoutRange";d:0.134;s:87:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testIndividualIpAddressWithRange";d:0.045;s:87:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testIndividualIPAddressWithAlias";d:0.044;s:93:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testDomainNamePassedInPlaceOfIPAddress";d:0.045;s:91:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testCIDRNotatedIPAddressWithoutRange";d:0.052;s:96:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testCIDRNotatedIPAddressOutsideRangeLimit";d:0.042;s:92:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testAllocationWithPortsExceedingLimit";d:0.042;s:78:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testInvalidPortProvided";d:0.042;s:105:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testPortRangeOutsideOfRangeLimits with data set #0";d:0.04;s:105:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testPortRangeOutsideOfRangeLimits with data set #1";d:0.039;s:105:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testPortRangeOutsideOfRangeLimits with data set #2";d:0.038;s:105:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testPortRangeOutsideOfRangeLimits with data set #3";d:0.038;s:105:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testPortRangeOutsideOfRangeLimits with data set #4";d:0.039;s:105:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testPortRangeOutsideOfRangeLimits with data set #5";d:0.038;s:105:"Tests\Unit\Services\Allocations\AssignmentServiceTest::testPortRangeOutsideOfRangeLimits with data set #6";d:0.041;s:105:"Tests\Unit\Services\Allocations\SetDefaultAllocationServiceTest::testAllocationIsUpdated with data set #0";d:0.055;s:105:"Tests\Unit\Services\Allocations\SetDefaultAllocationServiceTest::testAllocationIsUpdated with data set #1";d:0.038;s:114:"Tests\Unit\Services\Allocations\SetDefaultAllocationServiceTest::testAllocationNotBelongingToServerThrowsException";d:0.067;s:101:"Tests\Unit\Services\Allocations\SetDefaultAllocationServiceTest::testExceptionThrownByGuzzleIsHandled";d:0.047;s:64:"Tests\Unit\Services\Api\KeyCreationServiceTest::testKeyIsCreated";d:0.639;s:90:"Tests\Unit\Services\Api\KeyCreationServiceTest::testIdentifierAndTokenAreOnlySetByFunction";d:0.037;s:93:"Tests\Unit\Services\Api\KeyCreationServiceTest::testPermissionsAreRetrievedForApplicationKeys";d:0.038;s:116:"Tests\Unit\Services\Api\KeyCreationServiceTest::testPermissionsAreNotRetrievedForNonApplicationKeys with data set #0";d:0.039;s:116:"Tests\Unit\Services\Api\KeyCreationServiceTest::testPermissionsAreNotRetrievedForNonApplicationKeys with data set #1";d:0.039;s:116:"Tests\Unit\Services\Api\KeyCreationServiceTest::testPermissionsAreNotRetrievedForNonApplicationKeys with data set #2";d:0.038;s:116:"Tests\Unit\Services\Api\KeyCreationServiceTest::testPermissionsAreNotRetrievedForNonApplicationKeys with data set #3";d:0.038;s:83:"Tests\Unit\Services\DaemonKeys\DaemonKeyCreationServiceTest::testDaemonKeyIsCreated";d:0.701;s:78:"Tests\Unit\Services\DaemonKeys\DaemonKeyProviderServiceTest::testKeyIsReturned";d:0.106;s:84:"Tests\Unit\Services\DaemonKeys\DaemonKeyProviderServiceTest::testExpiredKeyIsUpdated";d:0.045;s:87:"Tests\Unit\Services\DaemonKeys\DaemonKeyProviderServiceTest::testExpiredKeyIsNotUpdated";d:0.043;s:95:"Tests\Unit\Services\DaemonKeys\DaemonKeyProviderServiceTest::testMissingKeyIsCreatedIfRootAdmin";d:0.047;s:103:"Tests\Unit\Services\DaemonKeys\DaemonKeyProviderServiceTest::testMissingKeyIsCreatedIfUserIsServerOwner";d:0.043;s:94:"Tests\Unit\Services\DaemonKeys\DaemonKeyProviderServiceTest::testMissingKeyIsCreatedForSubuser";d:0.043;s:105:"Tests\Unit\Services\DaemonKeys\DaemonKeyProviderServiceTest::testExceptionIsThrownIfUserDoesNotDeserveKey";d:0.046;s:75:"Tests\Unit\Services\DaemonKeys\DaemonKeyUpdateServiceTest::testKeyIsUpdated";d:0.044;s:95:"Tests\Unit\Services\DaemonKeys\RevokeMultipleDaemonKeysServiceTest::testSuccessfulKeyRevocation";d:0.132;s:110:"Tests\Unit\Services\DaemonKeys\RevokeMultipleDaemonKeysServiceTest::testExceptionThrownFromDaemonCallIsHandled";d:0.082;s:107:"Tests\Unit\Services\DaemonKeys\RevokeMultipleDaemonKeysServiceTest::testIgnoredExceptionsAreHandledProperly";d:0.045;s:80:"Tests\Unit\Services\Databases\DatabasePasswordServiceTest::testPasswordIsChanged";d:0.61;s:102:"Tests\Unit\Services\Databases\DeployServerDatabaseServiceTest::testNonRandomFoundHost with data set #0";d:0.049;s:102:"Tests\Unit\Services\Databases\DeployServerDatabaseServiceTest::testNonRandomFoundHost with data set #1";d:0.039;s:82:"Tests\Unit\Services\Databases\DeployServerDatabaseServiceTest::testNonRandomNoHost";d:0.041;s:82:"Tests\Unit\Services\Databases\DeployServerDatabaseServiceTest::testRandomFoundHost";d:0.037;s:79:"Tests\Unit\Services\Databases\DeployServerDatabaseServiceTest::testRandomNoHost";d:0.036;s:107:"Tests\Unit\Services\Databases\DeployServerDatabaseServiceTest::testServerOverDatabaseLimit with data set #0";d:0.066;s:107:"Tests\Unit\Services\Databases\DeployServerDatabaseServiceTest::testServerOverDatabaseLimit with data set #1";d:0.037;s:84:"Tests\Unit\Services\Databases\DeployServerDatabaseServiceTest::testFeatureNotEnabled";d:0.052;s:86:"Tests\Unit\Services\Databases\Hosts\HostCreationServiceTest::testDatabaseHostIsCreated";d:0.046;s:78:"Tests\Unit\Services\Databases\Hosts\HostDeletionServiceTest::testHostIsDeleted";d:0.034;s:126:"Tests\Unit\Services\Databases\Hosts\HostDeletionServiceTest::testExceptionIsThrownIfDeletingHostWithDatabases with data set #0";d:0.04;s:126:"Tests\Unit\Services\Databases\Hosts\HostDeletionServiceTest::testExceptionIsThrownIfDeletingHostWithDatabases with data set #1";d:0.034;s:126:"Tests\Unit\Services\Databases\Hosts\HostDeletionServiceTest::testExceptionIsThrownIfDeletingHostWithDatabases with data set #2";d:0.034;s:94:"Tests\Unit\Services\Databases\Hosts\HostUpdateServiceTest::testPasswordIsEncryptedWhenProvided";d:0.037;s:99:"Tests\Unit\Services\Databases\Hosts\HostUpdateServiceTest::testUpdateOccursWhenNoPasswordIsProvided";d:0.036;s:80:"Tests\Unit\Services\Eggs\EggConfigurationServiceTest::testCorrectArrayIsReturned";d:0.04;s:100:"Tests\Unit\Services\Eggs\EggConfigurationServiceTest::testFunctionHandlesIntegerPassedInPlaceOfModel";d:0.036;s:101:"Tests\Unit\Services\Services\Options\EggCreationServiceTest::testCreateNewModelWithoutUsingConfigFrom";d:0.047;s:94:"Tests\Unit\Services\Services\Options\EggCreationServiceTest::testCreateNewModelUsingConfigFrom";d:0.04;s:113:"Tests\Unit\Services\Services\Options\EggCreationServiceTest::testDataProvidedByHandlerTakesPriorityOverPassedData";d:0.039;s:112:"Tests\Unit\Services\Services\Options\EggCreationServiceTest::testExceptionIsThrownIfNoParentConfigurationIsFound";d:0.04;s:96:"Tests\Unit\Services\Services\Options\EggDeletionServiceTest::testEggIsDeletedIfNoServersAreFound";d:0.038;s:99:"Tests\Unit\Services\Services\Options\EggDeletionServiceTest::testExceptionIsThrownIfServersAreFound";d:0.037;s:102:"Tests\Unit\Services\Services\Options\EggDeletionServiceTest::testExceptionIsThrownIfChildrenArePresent";d:0.038;s:101:"Tests\Unit\Services\Services\Options\EggUpdateServiceTest::testEggIsUpdatedWhenNoConfigFromIsProvided";d:0.042;s:105:"Tests\Unit\Services\Services\Options\EggUpdateServiceTest::testOptionIsUpdatedWhenValidConfigFromIsPassed";d:0.041;s:109:"Tests\Unit\Services\Services\Options\EggUpdateServiceTest::testExceptionIsThrownIfInvalidParentConfigIsPassed";d:0.049;s:95:"Tests\Unit\Services\Services\Options\EggUpdateServiceTest::testIntegerCanBePassedInPlaceOfModel";d:0.038;s:105:"Tests\Unit\Services\Services\Options\InstallScriptServiceTest::testUpdateWithValidCopyScriptFromAttribute";d:0.042;s:107:"Tests\Unit\Services\Services\Options\InstallScriptServiceTest::testUpdateWithInvalidCopyScriptFromAttribute";d:0.044;s:106:"Tests\Unit\Services\Services\Options\InstallScriptServiceTest::testUpdateWithoutNewCopyScriptFromAttribute";d:0.038;s:103:"Tests\Unit\Services\Services\Options\InstallScriptServiceTest::testFunctionAcceptsIntegerInPlaceOfModel";d:0.039;s:84:"Tests\Unit\Services\Eggs\Sharing\EggExporterServiceTest::testJsonStructureIsExported";d:0.043;s:91:"Tests\Unit\Services\Services\Sharing\EggImporterServiceTest::testEggConfigurationIsImported";d:0.06;s:97:"Tests\Unit\Services\Services\Sharing\EggImporterServiceTest::testExceptionIsThrownIfFileIsInvalid";d:0.04;s:98:"Tests\Unit\Services\Services\Sharing\EggImporterServiceTest::testExceptionIsThrownIfFileIsNotAFile";d:0.036;s:105:"Tests\Unit\Services\Services\Sharing\EggImporterServiceTest::testExceptionIsThrownIfJsonMetaDataIsInvalid";d:0.037;s:101:"Tests\Unit\Services\Services\Sharing\EggImporterServiceTest::testExceptionIsThrownIfBadJsonIsProvided";d:0.039;s:79:"Tests\Unit\Services\Eggs\Sharing\EggUpdateImporterServiceTest::testEggIsUpdated";d:0.044;s:103:"Tests\Unit\Services\Eggs\Sharing\EggUpdateImporterServiceTest::testVariablesMissingFromImportAreDeleted";d:0.04;s:99:"Tests\Unit\Services\Eggs\Sharing\EggUpdateImporterServiceTest::testExceptionIsThrownIfFileIsInvalid";d:0.046;s:100:"Tests\Unit\Services\Eggs\Sharing\EggUpdateImporterServiceTest::testExceptionIsThrownIfFileIsNotAFile";d:0.036;s:107:"Tests\Unit\Services\Eggs\Sharing\EggUpdateImporterServiceTest::testExceptionIsThrownIfJsonMetaDataIsInvalid";d:0.036;s:103:"Tests\Unit\Services\Eggs\Sharing\EggUpdateImporterServiceTest::testExceptionIsThrownIfBadJsonIsProvided";d:0.043;s:94:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testVariableIsCreatedAndStored";d:0.043;s:108:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testOptionsPassedInArrayKeyAreParsedProperly";d:0.036;s:98:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testNullOptionValueIsPassedAsArray";d:0.036;s:146:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #0";d:0.038;s:146:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #1";d:0.037;s:146:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #2";d:0.036;s:146:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #3";d:0.037;s:146:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #4";d:0.036;s:146:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #5";d:0.036;s:146:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #6";d:0.038;s:146:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #7";d:0.037;s:146:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #8";d:0.035;s:97:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testEggIdPassedInDataIsNotApplied";d:0.036;s:107:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testInvalidValidationRulesResultInException";d:0.049;s:106:"Tests\Unit\Services\Eggs\Variables\VariableCreationServiceTest::testExceptionNotCausedByBadRuleIsNotCaught";d:0.036;s:116:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testVariableIsUpdatedWhenNoEnvironmentVariableIsPassed";d:0.04;s:82:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testNullDefaultValue";d:0.039;s:119:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testVariableIsUpdatedWhenValidEnvironmentVariableIsPassed";d:0.04;s:96:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testNullOptionValueIsPassedAsArray";d:0.039;s:116:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testDataPassedIntoHandlerTakesLowerPriorityThanDataSet";d:0.038;s:115:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testExceptionIsThrownIfEnvironmentVariableIsNotUnique";d:0.04;s:144:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #0";d:0.04;s:144:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #1";d:0.038;s:144:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #2";d:0.039;s:144:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #3";d:0.039;s:144:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #4";d:0.039;s:144:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #5";d:0.039;s:144:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #6";d:0.04;s:144:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #7";d:0.039;s:144:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testExceptionIsThrownIfEnvironmentVariableIsInListOfReservedNames with data set #8";d:0.039;s:105:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testInvalidValidationRulesResultInException";d:0.041;s:104:"Tests\Unit\Services\Eggs\Variables\VariableUpdateServiceTest::testExceptionNotCausedByBadRuleIsNotCaught";d:0.051;s:82:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testPanelVersionIsReturned";d:0.047;s:103:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testPanelVersionIsReturnedAsErrorIfNoKeyIsFound";d:0.039;s:83:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testDaemonVersionIsReturned";d:0.04;s:104:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testDaemonVersionIsReturnedAsErrorIfNoKeyIsFound";d:0.039;s:80:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testDiscordUrlIsReturned";d:0.039;s:130:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testCorrectBooleanValueIsReturnedWhenCheckingPanelVersion with data set #0";d:0.038;s:130:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testCorrectBooleanValueIsReturnedWhenCheckingPanelVersion with data set #1";d:0.037;s:130:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testCorrectBooleanValueIsReturnedWhenCheckingPanelVersion with data set #2";d:0.037;s:131:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testCorrectBooleanValueIsReturnedWhenCheckingDaemonVersion with data set #0";d:0.037;s:131:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testCorrectBooleanValueIsReturnedWhenCheckingDaemonVersion with data set #1";d:0.038;s:131:"Tests\Unit\Services\Helpers\SoftwareVersionServiceTest::testCorrectBooleanValueIsReturnedWhenCheckingDaemonVersion with data set #2";d:0.038;s:80:"Tests\Unit\Services\Locations\LocationCreationServiceTest::testLocationIsCreated";d:0.041;s:80:"Tests\Unit\Services\Locations\LocationDeletionServiceTest::testLocationIsDeleted";d:0.04;s:98:"Tests\Unit\Services\Locations\LocationDeletionServiceTest::testExceptionIsThrownIfNodesAreAttached";d:0.041;s:78:"Tests\Unit\Services\Locations\LocationUpdateServiceTest::testLocationIsUpdated";d:0.055;s:87:"Tests\Unit\Services\Locations\LocationUpdateServiceTest::testModelCanBePassedToFunction";d:0.042;s:74:"Tests\Unit\Services\Services\NestCreationServiceTest::testCreateNewService";d:0.045;s:88:"Tests\Unit\Services\Services\NestCreationServiceTest::testCreateServiceWithDefinedAuthor";d:0.042;s:74:"Tests\Unit\Services\Services\NestDeletionServiceTest::testServiceIsDeleted";d:0.041;s:112:"Tests\Unit\Services\Services\NestDeletionServiceTest::testExceptionIsThrownIfServersAreAttached with data set #0";d:0.04;s:112:"Tests\Unit\Services\Services\NestDeletionServiceTest::testExceptionIsThrownIfServersAreAttached with data set #1";d:0.039;s:112:"Tests\Unit\Services\Services\NestDeletionServiceTest::testExceptionIsThrownIfServersAreAttached with data set #2";d:0.039;s:112:"Tests\Unit\Services\Services\NestDeletionServiceTest::testExceptionIsThrownIfServersAreAttached with data set #3";d:0.039;s:87:"Tests\Unit\Services\Services\NestUpdateServiceTest::testAuthorArrayKeyIsRemovedIfPassed";d:0.041;s:95:"Tests\Unit\Services\Services\NestUpdateServiceTest::testServiceIsUpdatedWhenNoAuthorKeyIsPassed";d:0.041;s:94:"Tests\Unit\Services\Nodes\NodeCreationServiceTest::testNodeIsCreatedAndDaemonSecretIsGenerated";d:0.041;s:90:"Tests\Unit\Services\Nodes\NodeDeletionServiceTest::testNodeIsDeletedIfNoServersAreAttached";d:0.042;s:98:"Tests\Unit\Services\Nodes\NodeDeletionServiceTest::testExceptionIsThrownIfServersAreAttachedToNode";d:0.042;s:96:"Tests\Unit\Services\Nodes\NodeDeletionServiceTest::testModelCanBePassedToFunctionInPlaceOfNodeId";d:0.042;s:88:"Tests\Unit\Services\Nodes\NodeUpdateServiceTest::testNodeIsUpdatedAndDaemonSecretIsReset";d:0.061;s:93:"Tests\Unit\Services\Nodes\NodeUpdateServiceTest::testNodeIsUpdatedAndDaemonSecretIsNotChanged";d:0.043;s:81:"Tests\Unit\Services\Nodes\NodeUpdateServiceTest::testExceptionRelatedToConnection";d:0.05;s:84:"Tests\Unit\Services\Nodes\NodeUpdateServiceTest::testExceptionNotRelatedToConnection";d:0.044;s:88:"Tests\Unit\Services\Packs\ExportPackServiceTest::testFilesAreBundledIntoZipWhenRequested";d:0.06;s:87:"Tests\Unit\Services\Packs\ExportPackServiceTest::testPackConfigurationIsSavedAsJsonFile";d:0.052;s:84:"Tests\Unit\Services\Packs\ExportPackServiceTest::testPackIdCanBePassedInPlaceOfModel";d:0.047;s:97:"Tests\Unit\Services\Packs\ExportPackServiceTest::testExceptionIsThrownIfZipArchiveCannotBeCreated";d:0.045;s:94:"Tests\Unit\Services\Packs\PackCreationServiceTest::testPackIsCreatedWhenNoUploadedFileIsPassed";d:0.044;s:111:"Tests\Unit\Services\Packs\PackCreationServiceTest::testPackIsCreatedWhenUploadedFileIsProvided with data set #0";d:0.044;s:111:"Tests\Unit\Services\Packs\PackCreationServiceTest::testPackIsCreatedWhenUploadedFileIsProvided with data set #1";d:0.042;s:97:"Tests\Unit\Services\Packs\PackCreationServiceTest::testExceptionIsThrownIfInvalidUploadIsProvided";d:0.043;s:113:"Tests\Unit\Services\Packs\PackCreationServiceTest::testExceptionIsThrownIfInvalidMimetypeIsFound with data set #0";d:0.041;s:113:"Tests\Unit\Services\Packs\PackCreationServiceTest::testExceptionIsThrownIfInvalidMimetypeIsFound with data set #1";d:0.04;s:113:"Tests\Unit\Services\Packs\PackCreationServiceTest::testExceptionIsThrownIfInvalidMimetypeIsFound with data set #2";d:0.039;s:68:"Tests\Unit\Services\Packs\PackDeletionServiceTest::testPackIsDeleted";d:0.044;s:86:"Tests\Unit\Services\Packs\PackDeletionServiceTest::testPackIdCanBePassedInPlaceOfModel";d:0.042;s:96:"Tests\Unit\Services\Packs\PackDeletionServiceTest::testExceptionIsThrownIfServerIsAttachedToPack";d:0.042;s:66:"Tests\Unit\Services\Packs\PackUpdateServiceTest::testPackIsUpdated";d:0.045;s:108:"Tests\Unit\Services\Packs\PackUpdateServiceTest::testExceptionIsThrownIfModifyingEggIdWhenServersAreAttached";d:0.043;s:84:"Tests\Unit\Services\Packs\PackUpdateServiceTest::testPackIdCanBePassedInPlaceOfModel";d:0.043;s:93:"Tests\Unit\Services\Packs\TemplateUploadServiceTest::testJsonFileIsProcessed with data set #0";d:0.045;s:93:"Tests\Unit\Services\Packs\TemplateUploadServiceTest::testJsonFileIsProcessed with data set #1";d:0.042;s:75:"Tests\Unit\Services\Packs\TemplateUploadServiceTest::testZipfileIsProcessed";d:0.041;s:95:"Tests\Unit\Services\Packs\TemplateUploadServiceTest::testExceptionIsThrownIfFileUploadIsInvalid";d:0.039;s:110:"Tests\Unit\Services\Packs\TemplateUploadServiceTest::testExceptionIsThrownIfMimetypeIsInvalid with data set #0";d:0.039;s:110:"Tests\Unit\Services\Packs\TemplateUploadServiceTest::testExceptionIsThrownIfMimetypeIsInvalid with data set #1";d:0.039;s:110:"Tests\Unit\Services\Packs\TemplateUploadServiceTest::testExceptionIsThrownIfMimetypeIsInvalid with data set #2";d:0.039;s:98:"Tests\Unit\Services\Packs\TemplateUploadServiceTest::testExceptionIsThrownIfZipArchiveIsUnreadable";d:0.041;s:121:"Tests\Unit\Services\Packs\TemplateUploadServiceTest::testExceptionIsThrownIfZipDoesNotContainProperFiles with data set #0";d:0.041;s:121:"Tests\Unit\Services\Packs\TemplateUploadServiceTest::testExceptionIsThrownIfZipDoesNotContainProperFiles with data set #1";d:0.052;s:121:"Tests\Unit\Services\Packs\TemplateUploadServiceTest::testExceptionIsThrownIfZipDoesNotContainProperFiles with data set #2";d:0.039;s:107:"Tests\Unit\Services\Packs\TemplateUploadServiceTest::testExceptionIsThrownIfArchiveCannotBeExtractedFromZip";d:0.046;s:85:"Tests\Unit\Services\Schedules\ProcessScheduleServiceTest::testScheduleIsUpdatedAndRun";d:0.057;s:94:"Tests\Unit\Services\Servers\EnvironmentServiceTest::testSettingEnvironmentKeyPersistsItInArray";d:0.041;s:112:"Tests\Unit\Services\Servers\EnvironmentServiceTest::testProcessShouldReturnDefaultEnvironmentVariablesForAServer";d:0.042;s:90:"Tests\Unit\Services\Servers\EnvironmentServiceTest::testProcessShouldReturnKeySetAtRuntime";d:0.043;s:115:"Tests\Unit\Services\Servers\EnvironmentServiceTest::testProcessShouldAllowOverwritingVariablesWithConfigurationFile";d:0.041;s:99:"Tests\Unit\Services\Servers\EnvironmentServiceTest::testVariablesSetInConfigurationAllowForClosures";d:0.041;s:120:"Tests\Unit\Services\Servers\EnvironmentServiceTest::testProcessShouldAllowOverwritingDefaultVariablesWithRuntimeProvided";d:0.042;s:102:"Tests\Unit\Services\Servers\ReinstallServerServiceTest::testServerShouldBeReinstalledWhenModelIsPassed";d:0.044;s:105:"Tests\Unit\Services\Servers\ReinstallServerServiceTest::testServerShouldBeReinstalledWhenServerIdIsPassed";d:0.042;s:114:"Tests\Unit\Services\Servers\ReinstallServerServiceTest::testExceptionThrownByGuzzleShouldBeReRenderedAsDisplayable";d:0.041;s:121:"Tests\Unit\Services\Servers\ReinstallServerServiceTest::testExceptionNotThrownByGuzzleShouldNotBeTransformedToDisplayable";d:0.044;s:99:"Tests\Unit\Services\Servers\ServerConfigurationStructureServiceTest::testCorrectStructureIsReturned";d:0.057;s:116:"Tests\Unit\Services\Servers\ServerCreationServiceTest::testCreateShouldHitAllOfTheNecessaryServicesAndStoreTheServer";d:0.062;s:75:"Tests\Unit\Services\Servers\ServerCreationServiceTest::testDataIsAutoFilled";d:0.052;s:79:"Tests\Unit\Services\Servers\ServerCreationServiceTest::testAutoDeploymentObject";d:0.048;s:99:"Tests\Unit\Services\Servers\ServerCreationServiceTest::testExceptionShouldBeThrownIfTheRequestFails";d:0.046;s:81:"Tests\Unit\Services\Servers\ServerDeletionServiceTest::testForceParameterCanBeSet";d:0.046;s:89:"Tests\Unit\Services\Servers\ServerDeletionServiceTest::testServerCanBeDeletedWithoutForce";d:0.045;s:113:"Tests\Unit\Services\Servers\ServerDeletionServiceTest::testServerShouldBeDeletedEvenWhenFailureOccursIfForceIsSet";d:0.044;s:120:"Tests\Unit\Services\Servers\ServerDeletionServiceTest::testExceptionShouldBeThrownIfDaemonReturnsAnErrorAndForceIsNotSet";d:0.043;s:78:"Tests\Unit\Services\Servers\StartupCommandViewServiceTest::testServiceResponse";d:0.045;s:91:"Tests\Unit\Services\Servers\StartupModificationServiceTest::testStartupModifiedAsNormalUser";d:0.044;s:94:"Tests\Unit\Services\Servers\StartupModificationServiceTest::testStartupModificationAsAdminUser";d:0.045;s:105:"Tests\Unit\Services\Servers\SuspensionServiceTest::testFunctionShouldAcceptAnIntegerInPlaceOfAServerModel";d:0.045;s:98:"Tests\Unit\Services\Servers\SuspensionServiceTest::testServerShouldBeSuspendedWhenNoActionIsPassed";d:0.058;s:107:"Tests\Unit\Services\Servers\SuspensionServiceTest::testServerShouldBeUnsuspendedWhenUnsuspendActionIsPassed";d:0.041;s:123:"Tests\Unit\Services\Servers\SuspensionServiceTest::testNoActionShouldHappenIfServerIsAlreadyUnsuspendedAndActionIsUnsuspend";d:0.042;s:119:"Tests\Unit\Services\Servers\SuspensionServiceTest::testNoActionShouldHappenIfServerIsAlreadySuspendedAndActionIsSuspend";d:0.042;s:119:"Tests\Unit\Services\Servers\SuspensionServiceTest::testExceptionThrownByGuzzleShouldBeCaughtAndTransformedToDisplayable";d:0.043;s:96:"Tests\Unit\Services\Servers\SuspensionServiceTest::testExceptionShouldBeThrownIfActionIsNotValid";d:0.041;s:113:"Tests\Unit\Services\Servers\VariableValidatorServiceTest::testEmptyResultSetShouldBeReturnedIfNoVariablesAreFound";d:0.038;s:140:"Tests\Unit\Services\Servers\VariableValidatorServiceTest::testValidatorShouldNotProcessVariablesSetAsNotUserEditableWhenAdminFlagIsNotPassed";d:0.044;s:114:"Tests\Unit\Services\Servers\VariableValidatorServiceTest::testValidatorShouldProcessAllVariablesWhenAdminFlagIsSet";d:0.044;s:124:"Tests\Unit\Services\Servers\VariableValidatorServiceTest::testValidatorShouldThrowExceptionWhenAValidationErrorIsEncountered";d:0.042;s:95:"Tests\Unit\Services\Subusers\PermissionCreationServiceTest::testPermissionsAreAssignedCorrectly";d:0.042;s:87:"Tests\Unit\Services\Subusers\SubuserCreationServiceTest::testAccountIsCreatedForNewUser";d:0.047;s:93:"Tests\Unit\Services\Subusers\SubuserCreationServiceTest::testExistingUserCanBeAddedAsASubuser";d:0.046;s:97:"Tests\Unit\Services\Subusers\SubuserCreationServiceTest::testExceptionIsThrownIfUserIsServerOwner";d:0.042;s:101:"Tests\Unit\Services\Subusers\SubuserCreationServiceTest::testExceptionIsThrownIfUserIsAlreadyASubuser";d:0.042;s:80:"Tests\Unit\Services\Subusers\SubuserUpdateServiceTest::testPermissionsAreUpdated";d:0.043;s:99:"Tests\Unit\Services\Subusers\SubuserUpdateServiceTest::testExceptionIsThrownIfDaemonConnectionFails";d:0.043;s:83:"Tests\Unit\Services\Users\ToggleTwoFactorServiceTest::testTwoFactorIsEnabledForUser";d:0.056;s:77:"Tests\Unit\Services\Users\ToggleTwoFactorServiceTest::testTwoFactorIsDisabled";d:0.044;s:89:"Tests\Unit\Services\Users\ToggleTwoFactorServiceTest::testTwoFactorRemainsDisabledForUser";d:0.043;s:91:"Tests\Unit\Services\Users\ToggleTwoFactorServiceTest::testExceptionIsThrownIfTokenIsInvalid";d:0.045;s:82:"Tests\Unit\Services\Users\TwoFactorSetupServiceTest::testSecretAndImageAreReturned";d:0.047;s:84:"Tests\Unit\Services\UserCreationServiceTest::testUserIsCreatedWhenPasswordIsProvided";d:0.055;s:74:"Tests\Unit\Services\UserCreationServiceTest::testUuidPassedInDataIsIgnored";d:0.044;s:86:"Tests\Unit\Services\UserCreationServiceTest::testUserIsCreatedWhenNoPasswordIsProvided";d:0.043;s:99:"Tests\Unit\Services\Users\UserDeletionServiceTest::testUserIsDeletedIfNoServersAreAttachedToAccount";d:0.042;s:101:"Tests\Unit\Services\Users\UserDeletionServiceTest::testExceptionIsThrownIfServersAreAttachedToAccount";d:0.044;s:86:"Tests\Unit\Services\Users\UserDeletionServiceTest::testModelCanBePassedInPlaceOfUserId";d:0.042;s:119:"Tests\Unit\Services\Users\UserUpdateServiceTest::testUpdateUserWithoutTouchingHasherIfNoPasswordPassed with data set #0";d:0.045;s:119:"Tests\Unit\Services\Users\UserUpdateServiceTest::testUpdateUserWithoutTouchingHasherIfNoPasswordPassed with data set #1";d:0.047;s:119:"Tests\Unit\Services\Users\UserUpdateServiceTest::testUpdateUserWithoutTouchingHasherIfNoPasswordPassed with data set #2";d:0.042;s:119:"Tests\Unit\Services\Users\UserUpdateServiceTest::testUpdateUserWithoutTouchingHasherIfNoPasswordPassed with data set #3";d:0.042;s:88:"Tests\Unit\Services\Users\UserUpdateServiceTest::testUpdateUserAndHashPasswordIfProvided";d:0.042;s:90:"Tests\Unit\Services\Users\UserUpdateServiceTest::testAdministrativeUserRevokingAdminStatus";d:0.041;s:89:"Tests\Unit\Services\Users\UserUpdateServiceTest::testNormalUserShouldNotRevokeAdminStatus";d:0.041;}}} \ No newline at end of file diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index ade6ff4a7..b211ae598 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -28,7 +28,6 @@ use Pterodactyl\Http\Middleware\Api\ApiSubstituteBindings; use Illuminate\Foundation\Http\Middleware\ValidatePostSize; use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse; use Pterodactyl\Http\Middleware\Server\AccessingValidServer; -use Pterodactyl\Http\Middleware\Server\AuthenticateAsSubuser; use Pterodactyl\Http\Middleware\Api\Daemon\DaemonAuthenticate; use Pterodactyl\Http\Middleware\RequireTwoFactorAuthentication; use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode; @@ -101,7 +100,6 @@ class Kernel extends HttpKernel 'auth.basic' => AuthenticateWithBasicAuth::class, 'guest' => RedirectIfAuthenticated::class, 'server' => AccessingValidServer::class, - 'subuser.auth' => AuthenticateAsSubuser::class, 'admin' => AdminAuthenticate::class, 'csrf' => VerifyCsrfToken::class, 'throttle' => ThrottleRequests::class, diff --git a/app/Http/Middleware/Server/AuthenticateAsSubuser.php b/app/Http/Middleware/Server/AuthenticateAsSubuser.php deleted file mode 100644 index 06707117a..000000000 --- a/app/Http/Middleware/Server/AuthenticateAsSubuser.php +++ /dev/null @@ -1,59 +0,0 @@ -. - * - * This software is licensed under the terms of the MIT license. - * https://opensource.org/licenses/MIT - */ - -namespace Pterodactyl\Http\Middleware\Server; - -use Closure; -use Illuminate\Http\Request; -use Pterodactyl\Services\DaemonKeys\DaemonKeyProviderService; -use Pterodactyl\Exceptions\Repository\RecordNotFoundException; -use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; - -class AuthenticateAsSubuser -{ - /** - * @var \Pterodactyl\Services\DaemonKeys\DaemonKeyProviderService - */ - private $keyProviderService; - - /** - * SubuserAccessAuthenticate constructor. - * - * @param \Pterodactyl\Services\DaemonKeys\DaemonKeyProviderService $keyProviderService - */ - public function __construct(DaemonKeyProviderService $keyProviderService) - { - $this->keyProviderService = $keyProviderService; - } - - /** - * Determine if a subuser has permissions to access a server, if so set their access token. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @return mixed - * - * @throws \Pterodactyl\Exceptions\Model\DataValidationException - * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException - */ - public function handle(Request $request, Closure $next) - { - $server = $request->attributes->get('server'); - - try { - $token = $this->keyProviderService->handle($server, $request->user()); - } catch (RecordNotFoundException $exception) { - throw new AccessDeniedHttpException('This account does not have permission to access this server.'); - } - - $request->attributes->set('server_token', $token); - - return $next($request); - } -} diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 4e6099b9b..e6cb8b169 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -33,7 +33,7 @@ class RouteServiceProvider extends ServiceProvider ->namespace($this->namespace . '\Auth') ->group(base_path('routes/auth.php')); - Route::middleware(['web', 'csrf', 'auth', 'server', 'subuser.auth', 'node.maintenance']) + Route::middleware(['web', 'csrf', 'auth', 'server', 'node.maintenance']) ->prefix('/api/server/{server}') ->namespace($this->namespace . '\Server') ->group(base_path('routes/server.php')); diff --git a/app/Services/DaemonKeys/DaemonKeyCreationService.php b/app/Services/DaemonKeys/DaemonKeyCreationService.php deleted file mode 100644 index d2551324a..000000000 --- a/app/Services/DaemonKeys/DaemonKeyCreationService.php +++ /dev/null @@ -1,87 +0,0 @@ -. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -namespace Pterodactyl\Services\DaemonKeys; - -use Carbon\Carbon; -use Illuminate\Contracts\Config\Repository as ConfigRepository; -use Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface; - -class DaemonKeyCreationService -{ - /** - * @var \Carbon\Carbon - */ - protected $carbon; - - /** - * @var \Illuminate\Contracts\Config\Repository - */ - protected $config; - - /** - * @var \Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface - */ - protected $repository; - - /** - * DaemonKeyCreationService constructor. - * - * @param \Carbon\Carbon $carbon - * @param \Illuminate\Contracts\Config\Repository $config - * @param \Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface $repository - */ - public function __construct( - Carbon $carbon, - ConfigRepository $config, - DaemonKeyRepositoryInterface $repository - ) { - $this->carbon = $carbon; - $this->config = $config; - $this->repository = $repository; - } - - /** - * Create a new daemon key to be used when connecting to a daemon. - * - * @param int $server - * @param int $user - * @return string - * - * @throws \Pterodactyl\Exceptions\Model\DataValidationException - */ - public function handle(int $server, int $user) - { - $secret = DaemonKeyRepositoryInterface::INTERNAL_KEY_IDENTIFIER . str_random(40); - - $this->repository->withoutFreshModel()->create([ - 'user_id' => $user, - 'server_id' => $server, - 'secret' => $secret, - 'expires_at' => $this->carbon->now()->addMinutes($this->config->get('pterodactyl.api.key_expire_time'))->toDateTimeString(), - ]); - - return $secret; - } -} diff --git a/app/Services/DaemonKeys/DaemonKeyProviderService.php b/app/Services/DaemonKeys/DaemonKeyProviderService.php deleted file mode 100644 index c875239d7..000000000 --- a/app/Services/DaemonKeys/DaemonKeyProviderService.php +++ /dev/null @@ -1,121 +0,0 @@ -. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -namespace Pterodactyl\Services\DaemonKeys; - -use Carbon\Carbon; -use Pterodactyl\Models\User; -use Pterodactyl\Models\Server; -use Pterodactyl\Exceptions\Repository\RecordNotFoundException; -use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; -use Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface; - -class DaemonKeyProviderService -{ - /** - * @var \Pterodactyl\Services\DaemonKeys\DaemonKeyCreationService - */ - private $keyCreationService; - - /** - * @var \Pterodactyl\Services\DaemonKeys\DaemonKeyUpdateService - */ - private $keyUpdateService; - - /** - * @var \Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface - */ - private $repository; - - /** - * @var \Pterodactyl\Contracts\Repository\SubuserRepositoryInterface - */ - private $subuserRepository; - - /** - * GetDaemonKeyService constructor. - * - * @param \Pterodactyl\Services\DaemonKeys\DaemonKeyCreationService $keyCreationService - * @param \Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface $repository - * @param \Pterodactyl\Services\DaemonKeys\DaemonKeyUpdateService $keyUpdateService - * @param \Pterodactyl\Contracts\Repository\SubuserRepositoryInterface $subuserRepository - */ - public function __construct( - DaemonKeyCreationService $keyCreationService, - DaemonKeyRepositoryInterface $repository, - DaemonKeyUpdateService $keyUpdateService, - SubuserRepositoryInterface $subuserRepository - ) { - $this->keyCreationService = $keyCreationService; - $this->keyUpdateService = $keyUpdateService; - $this->repository = $repository; - $this->subuserRepository = $subuserRepository; - } - - /** - * Get the access key for a user on a specific server. - * - * @param \Pterodactyl\Models\Server $server - * @param \Pterodactyl\Models\User $user - * @param bool $updateIfExpired - * @return string - * - * @throws \Pterodactyl\Exceptions\Model\DataValidationException - * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException - */ - public function handle(Server $server, User $user, $updateIfExpired = true): string - { - try { - $key = $this->repository->findFirstWhere([ - ['user_id', '=', $user->id], - ['server_id', '=', $server->id], - ]); - } catch (RecordNotFoundException $exception) { - // If key doesn't exist but we are an admin or the server owner, - // create it. - if ($user->root_admin || $user->id === $server->owner_id) { - return $this->keyCreationService->handle($server->id, $user->id); - } - - // Check if user is a subuser for this server. Ideally they should always have - // a record associated with them in the database, but we should still handle - // that potentiality here. - // - // If no subuser is found, a RecordNotFoundException will be thrown, thus handling - // the parent error as well. - $subuser = $this->subuserRepository->findFirstWhere([ - ['user_id', '=', $user->id], - ['server_id', '=', $server->id], - ]); - - return $this->keyCreationService->handle($subuser->server_id, $subuser->user_id); - } - - if (! $updateIfExpired || Carbon::now()->diffInSeconds($key->expires_at, false) > 0) { - return $key->secret; - } - - return $this->keyUpdateService->handle($key->id); - } -} diff --git a/app/Services/DaemonKeys/DaemonKeyUpdateService.php b/app/Services/DaemonKeys/DaemonKeyUpdateService.php deleted file mode 100644 index 91427f3de..000000000 --- a/app/Services/DaemonKeys/DaemonKeyUpdateService.php +++ /dev/null @@ -1,88 +0,0 @@ -. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -namespace Pterodactyl\Services\DaemonKeys; - -use Carbon\Carbon; -use Webmozart\Assert\Assert; -use Illuminate\Contracts\Config\Repository as ConfigRepository; -use Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface; - -class DaemonKeyUpdateService -{ - /** - * @var \Carbon\Carbon - */ - protected $carbon; - - /** - * @var \Illuminate\Contracts\Config\Repository - */ - protected $config; - - /** - * @var \Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface - */ - protected $repository; - - /** - * DaemonKeyUpdateService constructor. - * - * @param \Carbon\Carbon $carbon - * @param \Illuminate\Contracts\Config\Repository $config - * @param \Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface $repository - */ - public function __construct( - Carbon $carbon, - ConfigRepository $config, - DaemonKeyRepositoryInterface $repository - ) { - $this->carbon = $carbon; - $this->config = $config; - $this->repository = $repository; - } - - /** - * Update a daemon key to expire the previous one. - * - * @param int $key - * @return string - * - * @throws \RuntimeException - * @throws \Pterodactyl\Exceptions\Model\DataValidationException - * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException - */ - public function handle($key) - { - Assert::integerish($key, 'First argument passed to handle must be an integer, received %s.'); - - $secret = DaemonKeyRepositoryInterface::INTERNAL_KEY_IDENTIFIER . str_random(40); - $this->repository->withoutFreshModel()->update($key, [ - 'secret' => $secret, - 'expires_at' => $this->carbon->now()->addMinutes($this->config->get('pterodactyl.api.key_expire_time'))->toDateTimeString(), - ]); - - return $secret; - } -} diff --git a/tests/Unit/Http/Middleware/Server/AuthenticateAsSubuserTest.php b/tests/Unit/Http/Middleware/Server/AuthenticateAsSubuserTest.php deleted file mode 100644 index b9199a67a..000000000 --- a/tests/Unit/Http/Middleware/Server/AuthenticateAsSubuserTest.php +++ /dev/null @@ -1,72 +0,0 @@ -keyProviderService = m::mock(DaemonKeyProviderService::class); - } - - /** - * Test a successful instance of the middleware. - */ - public function testSuccessfulMiddleware() - { - $model = factory(Server::class)->make(); - $user = $this->setRequestUser(); - $this->setRequestAttribute('server', $model); - - $this->keyProviderService->shouldReceive('handle')->with($model, $user)->once()->andReturn('abc123'); - - $this->getMiddleware()->handle($this->request, $this->getClosureAssertions()); - $this->assertRequestHasAttribute('server_token'); - $this->assertRequestAttributeEquals('abc123', 'server_token'); - } - - /** - * Test middleware handles missing token exception. - */ - public function testExceptionIsThrownIfNoTokenIsFound() - { - $this->expectException(AccessDeniedHttpException::class); - $this->expectExceptionMessage('This account does not have permission to access this server.'); - - $model = factory(Server::class)->make(); - $user = $this->setRequestUser(); - $this->setRequestAttribute('server', $model); - - $this->keyProviderService->shouldReceive('handle')->with($model, $user)->once()->andThrow(new RecordNotFoundException); - - $this->getMiddleware()->handle($this->request, $this->getClosureAssertions()); - } - - /** - * Return an instance of the middleware using mocked dependencies. - * - * @return \Pterodactyl\Http\Middleware\Server\AuthenticateAsSubuser - */ - public function getMiddleware(): AuthenticateAsSubuser - { - return new AuthenticateAsSubuser($this->keyProviderService); - } -} diff --git a/tests/Unit/Services/Allocations/AllocationDeletionServiceTest.php b/tests/Unit/Services/Allocations/AllocationDeletionServiceTest.php index f1ad8eb68..521aed20a 100644 --- a/tests/Unit/Services/Allocations/AllocationDeletionServiceTest.php +++ b/tests/Unit/Services/Allocations/AllocationDeletionServiceTest.php @@ -7,6 +7,7 @@ use Tests\TestCase; use Pterodactyl\Models\Allocation; use Pterodactyl\Services\Allocations\AllocationDeletionService; use Pterodactyl\Contracts\Repository\AllocationRepositoryInterface; +use Pterodactyl\Exceptions\Service\Allocation\ServerUsingAllocationException; class AllocationDeletionServiceTest extends TestCase { @@ -37,11 +38,11 @@ class AllocationDeletionServiceTest extends TestCase /** * Test that an exception gets thrown if an allocation is currently assigned to a server. - * - * @expectedException \Pterodactyl\Exceptions\Service\Allocation\ServerUsingAllocationException */ public function testExceptionThrownIfAssignedToServer() { + $this->expectException(ServerUsingAllocationException::class); + $model = factory(Allocation::class)->make(['server_id' => 123]); $this->getService()->handle($model); diff --git a/tests/Unit/Services/Allocations/AssignmentServiceTest.php b/tests/Unit/Services/Allocations/AssignmentServiceTest.php index 7449c81cc..0e6da9035 100644 --- a/tests/Unit/Services/Allocations/AssignmentServiceTest.php +++ b/tests/Unit/Services/Allocations/AssignmentServiceTest.php @@ -8,6 +8,10 @@ use Pterodactyl\Models\Node; use Illuminate\Database\ConnectionInterface; use Pterodactyl\Services\Allocations\AssignmentService; use Pterodactyl\Contracts\Repository\AllocationRepositoryInterface; +use Pterodactyl\Exceptions\Service\Allocation\CidrOutOfRangeException; +use Pterodactyl\Exceptions\Service\Allocation\PortOutOfRangeException; +use Pterodactyl\Exceptions\Service\Allocation\InvalidPortMappingException; +use Pterodactyl\Exceptions\Service\Allocation\TooManyPortsInRangeException; class AssignmentServiceTest extends TestCase { @@ -190,12 +194,12 @@ class AssignmentServiceTest extends TestCase /** * Test that a CIDR IP address with a range works properly. - * - * @expectedException \Pterodactyl\Exceptions\Service\Allocation\CidrOutOfRangeException - * @expectedExceptionMessage CIDR notation only allows masks between /25 and /32. */ public function testCIDRNotatedIPAddressOutsideRangeLimit() { + $this->expectException(CidrOutOfRangeException::class); + $this->expectExceptionMessage('CIDR notation only allows masks between /25 and /32.'); + $data = [ 'allocation_ip' => '192.168.1.100/20', 'allocation_ports' => ['2222'], @@ -206,12 +210,12 @@ class AssignmentServiceTest extends TestCase /** * Test that an exception is thrown if there are too many ports. - * - * @expectedException \Pterodactyl\Exceptions\Service\Allocation\TooManyPortsInRangeException - * @expectedExceptionMessage Adding more than 1000 ports in a single range at once is not supported. */ public function testAllocationWithPortsExceedingLimit() { + $this->expectException(TooManyPortsInRangeException::class); + $this->expectExceptionMessage('Adding more than 1000 ports in a single range at once is not supported.'); + $data = [ 'allocation_ip' => '192.168.1.1', 'allocation_ports' => ['5000-7000'], @@ -224,12 +228,12 @@ class AssignmentServiceTest extends TestCase /** * Test that an exception is thrown if an invalid port is provided. - * - * @expectedException \Pterodactyl\Exceptions\Service\Allocation\InvalidPortMappingException - * @expectedExceptionMessage The mapping provided for test123 was invalid and could not be processed. */ public function testInvalidPortProvided() { + $this->expectException(InvalidPortMappingException::class); + $this->expectExceptionMessage('The mapping provided for test123 was invalid and could not be processed.'); + $data = [ 'allocation_ip' => '192.168.1.1', 'allocation_ports' => ['test123'], @@ -245,11 +249,12 @@ class AssignmentServiceTest extends TestCase * @param array $ports * * @dataProvider invalidPortsDataProvider - * @expectedException \Pterodactyl\Exceptions\Service\Allocation\PortOutOfRangeException - * @expectedExceptionMessage Ports in an allocation must be greater than 1024 and less than or equal to 65535. */ public function testPortRangeOutsideOfRangeLimits(array $ports) { + $this->expectException(PortOutOfRangeException::class); + $this->expectExceptionMessage('Ports in an allocation must be greater than 1024 and less than or equal to 65535.'); + $data = ['allocation_ip' => '192.168.1.1', 'allocation_ports' => $ports]; $this->connection->shouldReceive('beginTransaction')->once()->withNoArgs()->andReturnNull(); diff --git a/tests/Unit/Services/Allocations/SetDefaultAllocationServiceTest.php b/tests/Unit/Services/Allocations/SetDefaultAllocationServiceTest.php deleted file mode 100644 index 75d1f32dd..000000000 --- a/tests/Unit/Services/Allocations/SetDefaultAllocationServiceTest.php +++ /dev/null @@ -1,156 +0,0 @@ -connection = m::mock(ConnectionInterface::class); - $this->daemonRepository = m::mock(DaemonRepositoryInterface::class); - $this->repository = m::mock(AllocationRepositoryInterface::class); - $this->serverRepository = m::mock(ServerRepositoryInterface::class); - } - - /** - * Test that an allocation can be updated. - * - * @dataProvider useModelDataProvider - */ - public function testAllocationIsUpdated(bool $useModel) - { - $allocations = factory(Allocation::class)->times(2)->make(); - $model = factory(Server::class)->make(); - if (! $useModel) { - $this->serverRepository->shouldReceive('find')->with(1234)->once()->andReturn($model); - } - - $this->repository->shouldReceive('findWhere')->with([['server_id', '=', $model->id]])->once()->andReturn($allocations); - $this->connection->shouldReceive('beginTransaction')->withNoArgs()->once()->andReturnNull(); - $this->serverRepository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf(); - $this->serverRepository->shouldReceive('update')->with($model->id, [ - 'allocation_id' => $allocations->first()->id, - ])->once()->andReturn(new Response); - - $this->daemonRepository->shouldReceive('setServer')->with($model)->once()->andReturnSelf(); - $this->daemonRepository->shouldReceive('update')->with([ - 'build' => [ - 'default' => [ - 'ip' => $allocations->first()->ip, - 'port' => $allocations->first()->port, - ], - 'ports|overwrite' => $allocations->groupBy('ip')->map(function ($item) { - return $item->pluck('port'); - })->toArray(), - ], - ])->once()->andReturn(new Response); - $this->connection->shouldReceive('commit')->withNoArgs()->once()->andReturnNull(); - - $response = $this->getService()->handle($useModel ? $model : 1234, $allocations->first()->id); - $this->assertNotEmpty($response); - $this->assertSame($allocations->first(), $response); - } - - /** - * Test that an allocation that doesn't belong to a server throws an exception. - * - * @expectedException \Pterodactyl\Exceptions\Service\Allocation\AllocationDoesNotBelongToServerException - */ - public function testAllocationNotBelongingToServerThrowsException() - { - $model = factory(Server::class)->make(); - $this->repository->shouldReceive('findWhere')->with([['server_id', '=', $model->id]])->once()->andReturn(collect()); - - $this->getService()->handle($model, 1234); - } - - /** - * Test that an exception thrown by guzzle is handled properly. - */ - public function testExceptionThrownByGuzzleIsHandled() - { - $this->configureExceptionMock(); - - $allocation = factory(Allocation::class)->make(); - $model = factory(Server::class)->make(); - - $this->repository->shouldReceive('findWhere')->with([['server_id', '=', $model->id]])->once()->andReturn(collect([$allocation])); - $this->connection->shouldReceive('beginTransaction')->withNoArgs()->once()->andReturnNull(); - $this->serverRepository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf(); - $this->serverRepository->shouldReceive('update')->with($model->id, [ - 'allocation_id' => $allocation->id, - ])->once()->andReturn(new Response); - - $this->daemonRepository->shouldReceive('setServer->update')->once()->andThrow($this->getExceptionMock()); - $this->connection->shouldReceive('rollBack')->withNoArgs()->once()->andReturnNull(); - - try { - $this->getService()->handle($model, $allocation->id); - } catch (PterodactylException $exception) { - $this->assertInstanceOf(DaemonConnectionException::class, $exception); - $this->assertInstanceOf(RequestException::class, $exception->getPrevious()); - } - } - - /** - * Data provider to determine if a model should be passed or an int. - * - * @return array - */ - public function useModelDataProvider(): array - { - return [[false], [true]]; - } - - /** - * Return an instance of the service with mocked dependencies. - * - * @return \Pterodactyl\Services\Allocations\SetDefaultAllocationService - */ - private function getService(): SetDefaultAllocationService - { - return new SetDefaultAllocationService($this->repository, $this->connection, $this->daemonRepository, $this->serverRepository); - } -} diff --git a/tests/Unit/Services/DaemonKeys/DaemonKeyCreationServiceTest.php b/tests/Unit/Services/DaemonKeys/DaemonKeyCreationServiceTest.php deleted file mode 100644 index 7c5bad2c2..000000000 --- a/tests/Unit/Services/DaemonKeys/DaemonKeyCreationServiceTest.php +++ /dev/null @@ -1,98 +0,0 @@ -. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -namespace Tests\Unit\Services\DaemonKeys; - -use Mockery as m; -use Carbon\Carbon; -use Tests\TestCase; -use phpmock\phpunit\PHPMock; -use Illuminate\Contracts\Config\Repository; -use Pterodactyl\Services\DaemonKeys\DaemonKeyCreationService; -use Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface; - -class DaemonKeyCreationServiceTest extends TestCase -{ - use PHPMock; - - /** - * @var \Carbon\Carbon|\Mockery\Mock - */ - protected $carbon; - - /** - * @var \Illuminate\Contracts\Config\Repository|\Mockery\Mock - */ - protected $config; - - /** - * @var \Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface|\Mockery\Mock - */ - protected $repository; - - /** - * @var \Pterodactyl\Services\DaemonKeys\DaemonKeyCreationService - */ - protected $service; - - /** - * Setup tests. - */ - public function setUp(): void - { - parent::setUp(); - - $this->carbon = m::mock(Carbon::class); - $this->config = m::Mock(Repository::class); - $this->repository = m::mock(DaemonKeyRepositoryInterface::class); - - $this->service = new DaemonKeyCreationService($this->carbon, $this->config, $this->repository); - } - - /** - * Test that a daemon key is created. - */ - public function testDaemonKeyIsCreated() - { - $this->getFunctionMock('\\Pterodactyl\\Services\\DaemonKeys', 'str_random') - ->expects($this->once())->willReturn('random_string'); - - $this->config->shouldReceive('get')->with('pterodactyl.api.key_expire_time')->once()->andReturn(100); - $this->carbon->shouldReceive('now')->withNoArgs()->once()->andReturnSelf() - ->shouldReceive('addMinutes')->with(100)->once()->andReturnSelf() - ->shouldReceive('toDateTimeString')->withNoArgs()->once()->andReturn('00:00:00'); - - $this->repository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf() - ->shouldReceive('create')->with([ - 'user_id' => 1, - 'server_id' => 2, - 'secret' => DaemonKeyRepositoryInterface::INTERNAL_KEY_IDENTIFIER . 'random_string', - 'expires_at' => '00:00:00', - ])->once()->andReturnNull(); - - $response = $this->service->handle(2, 1); - $this->assertNotEmpty($response); - $this->assertEquals('i_random_string', $response); - } -} diff --git a/tests/Unit/Services/DaemonKeys/DaemonKeyProviderServiceTest.php b/tests/Unit/Services/DaemonKeys/DaemonKeyProviderServiceTest.php deleted file mode 100644 index 74c34d3c0..000000000 --- a/tests/Unit/Services/DaemonKeys/DaemonKeyProviderServiceTest.php +++ /dev/null @@ -1,229 +0,0 @@ -. - * - * This software is licensed under the terms of the MIT license. - * https://opensource.org/licenses/MIT - */ - -namespace Tests\Unit\Services\DaemonKeys; - -use Mockery as m; -use Carbon\Carbon; -use Tests\TestCase; -use Pterodactyl\Models\User; -use Pterodactyl\Models\Server; -use Pterodactyl\Models\Subuser; -use Pterodactyl\Models\DaemonKey; -use Pterodactyl\Services\DaemonKeys\DaemonKeyUpdateService; -use Pterodactyl\Services\DaemonKeys\DaemonKeyCreationService; -use Pterodactyl\Services\DaemonKeys\DaemonKeyProviderService; -use Pterodactyl\Exceptions\Repository\RecordNotFoundException; -use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface; -use Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface; - -class DaemonKeyProviderServiceTest extends TestCase -{ - /** - * @var \Pterodactyl\Services\DaemonKeys\DaemonKeyCreationService|\Mockery\Mock - */ - private $keyCreationService; - - /** - * @var \Pterodactyl\Services\DaemonKeys\DaemonKeyUpdateService|\Mockery\Mock - */ - private $keyUpdateService; - - /** - * @var \Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface|\Mockery\Mock - */ - private $repository; - - /** - * @var \Pterodactyl\Contracts\Repository\SubuserRepositoryInterface|\Mockery\Mock - */ - private $subuserRepository; - - /** - * Setup tests. - */ - public function setUp(): void - { - parent::setUp(); - Carbon::setTestNow(Carbon::now()); - - $this->keyCreationService = m::mock(DaemonKeyCreationService::class); - $this->keyUpdateService = m::mock(DaemonKeyUpdateService::class); - $this->repository = m::mock(DaemonKeyRepositoryInterface::class); - $this->subuserRepository = m::mock(SubuserRepositoryInterface::class); - } - - /** - * Test that a key is returned correctly as a non-admin. - */ - public function testKeyIsReturned() - { - $server = factory(Server::class)->make(); - $user = factory(User::class)->make(); - $key = factory(DaemonKey::class)->make(); - - $this->repository->shouldReceive('findFirstWhere')->with([ - ['user_id', '=', $user->id], - ['server_id', '=', $server->id], - ])->once()->andReturn($key); - - $response = $this->getService()->handle($server, $user); - $this->assertNotEmpty($response); - $this->assertEquals($key->secret, $response); - } - - /** - * Test that an expired key is updated and then returned. - */ - public function testExpiredKeyIsUpdated() - { - $server = factory(Server::class)->make(); - $user = factory(User::class)->make(['root_admin' => 0]); - $key = factory(DaemonKey::class)->make(['expires_at' => Carbon::now()->subHour()]); - - $this->repository->shouldReceive('findFirstWhere')->with([ - ['user_id', '=', $user->id], - ['server_id', '=', $server->id], - ])->once()->andReturn($key); - - $this->keyUpdateService->shouldReceive('handle')->with($key->id)->once()->andReturn('abc123'); - - $response = $this->getService()->handle($server, $user); - $this->assertNotEmpty($response); - $this->assertEquals('abc123', $response); - } - - /** - * Test that an expired key is not updated and the expired key is returned. - */ - public function testExpiredKeyIsNotUpdated() - { - $server = factory(Server::class)->make(); - $user = factory(User::class)->make(['root_admin' => 0]); - $key = factory(DaemonKey::class)->make(['expires_at' => Carbon::now()->subHour()]); - - $this->repository->shouldReceive('findFirstWhere')->with([ - ['user_id', '=', $user->id], - ['server_id', '=', $server->id], - ])->once()->andReturn($key); - - $response = $this->getService()->handle($server, $user, false); - $this->assertNotEmpty($response); - $this->assertEquals($key->secret, $response); - } - - /** - * Test that a key is created if it is missing and the user is a - * root administrator. - */ - public function testMissingKeyIsCreatedIfRootAdmin() - { - $server = factory(Server::class)->make(); - $user = factory(User::class)->make(['root_admin' => 1]); - $key = factory(DaemonKey::class)->make(['expires_at' => Carbon::now()->subHour()]); - - $this->repository->shouldReceive('findFirstWhere')->with([ - ['user_id', '=', $user->id], - ['server_id', '=', $server->id], - ])->once()->andThrow(new RecordNotFoundException); - - $this->keyCreationService->shouldReceive('handle')->with($server->id, $user->id)->once()->andReturn($key->secret); - - $response = $this->getService()->handle($server, $user, false); - $this->assertNotEmpty($response); - $this->assertEquals($key->secret, $response); - } - - /** - * Test that a key is created if it is missing and the user is the - * server owner. - */ - public function testMissingKeyIsCreatedIfUserIsServerOwner() - { - $user = factory(User::class)->make(['root_admin' => 0]); - $server = factory(Server::class)->make(['owner_id' => $user->id]); - $key = factory(DaemonKey::class)->make(['expires_at' => Carbon::now()->subHour()]); - - $this->repository->shouldReceive('findFirstWhere')->with([ - ['user_id', '=', $user->id], - ['server_id', '=', $server->id], - ])->once()->andThrow(new RecordNotFoundException); - - $this->keyCreationService->shouldReceive('handle')->with($server->id, $user->id)->once()->andReturn($key->secret); - - $response = $this->getService()->handle($server, $user, false); - $this->assertNotEmpty($response); - $this->assertEquals($key->secret, $response); - } - - /** - * Test that a missing key is created for a subuser. - */ - public function testMissingKeyIsCreatedForSubuser() - { - $user = factory(User::class)->make(['root_admin' => 0]); - $server = factory(Server::class)->make(); - $key = factory(DaemonKey::class)->make(['expires_at' => Carbon::now()->subHour()]); - $subuser = factory(Subuser::class)->make(['user_id' => $user->id, 'server_id' => $server->id]); - - $this->repository->shouldReceive('findFirstWhere')->with([ - ['user_id', '=', $user->id], - ['server_id', '=', $server->id], - ])->once()->andThrow(new RecordNotFoundException); - - $this->subuserRepository->shouldReceive('findFirstWhere')->once()->with([ - ['user_id', '=', $user->id], - ['server_id', '=', $server->id], - ])->andReturn($subuser); - - $this->keyCreationService->shouldReceive('handle')->with($server->id, $user->id)->once()->andReturn($key->secret); - - $response = $this->getService()->handle($server, $user, false); - $this->assertNotEmpty($response); - $this->assertEquals($key->secret, $response); - } - - /** - * Test that an exception is thrown if the user should not get a key. - * - * @expectedException \Pterodactyl\Exceptions\Repository\RecordNotFoundException - */ - public function testExceptionIsThrownIfUserDoesNotDeserveKey() - { - $server = factory(Server::class)->make(); - $user = factory(User::class)->make(['root_admin' => 0]); - - $this->repository->shouldReceive('findFirstWhere')->with([ - ['user_id', '=', $user->id], - ['server_id', '=', $server->id], - ])->once()->andThrow(new RecordNotFoundException); - - $this->subuserRepository->shouldReceive('findFirstWhere')->once()->with([ - ['user_id', '=', $user->id], - ['server_id', '=', $server->id], - ])->andThrow(new RecordNotFoundException); - - $this->getService()->handle($server, $user, false); - } - - /** - * Return an instance of the service with mocked dependencies. - * - * @return \Pterodactyl\Services\DaemonKeys\DaemonKeyProviderService - */ - private function getService(): DaemonKeyProviderService - { - return new DaemonKeyProviderService( - $this->keyCreationService, - $this->repository, - $this->keyUpdateService, - $this->subuserRepository - ); - } -} diff --git a/tests/Unit/Services/DaemonKeys/DaemonKeyUpdateServiceTest.php b/tests/Unit/Services/DaemonKeys/DaemonKeyUpdateServiceTest.php deleted file mode 100644 index b1beadbce..000000000 --- a/tests/Unit/Services/DaemonKeys/DaemonKeyUpdateServiceTest.php +++ /dev/null @@ -1,83 +0,0 @@ -. - * - * This software is licensed under the terms of the MIT license. - * https://opensource.org/licenses/MIT - */ - -namespace Tests\Unit\Services\DaemonKeys; - -use Mockery as m; -use Carbon\Carbon; -use Tests\TestCase; -use phpmock\phpunit\PHPMock; -use Illuminate\Contracts\Config\Repository; -use Pterodactyl\Services\DaemonKeys\DaemonKeyUpdateService; -use Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface; - -class DaemonKeyUpdateServiceTest extends TestCase -{ - use PHPMock; - - /** - * @var \Carbon\Carbon|\Mockery\Mock - */ - protected $carbon; - - /** - * @var \Illuminate\Contracts\Config\Repository|\Mockery\Mock - */ - protected $config; - - /** - * @var \Pterodactyl\Contracts\Repository\DaemonKeyRepositoryInterface|\Mockery\Mock - */ - protected $repository; - - /** - * @var \Pterodactyl\Services\DaemonKeys\DaemonKeyUpdateService - */ - protected $service; - - /** - * Setup tests. - */ - public function setUp(): void - { - parent::setUp(); - - $this->carbon = m::Mock(Carbon::class); - $this->config = m::mock(Repository::class); - $this->repository = m::mock(DaemonKeyRepositoryInterface::class); - - $this->service = new DaemonKeyUpdateService($this->carbon, $this->config, $this->repository); - } - - /** - * Test that a key is updated. - */ - public function testKeyIsUpdated() - { - $secret = DaemonKeyRepositoryInterface::INTERNAL_KEY_IDENTIFIER . 'random_string'; - - $this->getFunctionMock('\\Pterodactyl\\Services\\DaemonKeys', 'str_random') - ->expects($this->once())->with(40)->willReturn('random_string'); - - $this->config->shouldReceive('get')->with('pterodactyl.api.key_expire_time')->once()->andReturn(100); - $this->carbon->shouldReceive('now')->withNoArgs()->once()->andReturnSelf() - ->shouldReceive('addMinutes')->with(100)->once()->andReturnSelf() - ->shouldReceive('toDateTimeString')->withNoArgs()->once()->andReturn('00:00:00'); - - $this->repository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf(); - $this->repository->shouldReceive('update')->with(123, [ - 'secret' => $secret, - 'expires_at' => '00:00:00', - ])->once()->andReturnNull(); - - $response = $this->service->handle(123); - $this->assertNotEmpty($response); - $this->assertEquals($secret, $response); - } -} diff --git a/tests/Unit/Services/DaemonKeys/RevokeMultipleDaemonKeysServiceTest.php b/tests/Unit/Services/DaemonKeys/RevokeMultipleDaemonKeysServiceTest.php deleted file mode 100644 index a10753cc0..000000000 --- a/tests/Unit/Services/DaemonKeys/RevokeMultipleDaemonKeysServiceTest.php +++ /dev/null @@ -1,116 +0,0 @@ -daemonRepository = m::mock(ServerRepositoryInterface::class); - $this->repository = m::mock(DaemonKeyRepositoryInterface::class); - } - - /** - * Test that keys can be successfully revoked. - */ - public function testSuccessfulKeyRevocation() - { - $user = factory(User::class)->make(); - $node = factory(Node::class)->make(); - $key = factory(DaemonKey::class)->make(['user_id' => $user->id]); - $key->setRelation('node', $node); - - $this->repository->shouldReceive('getKeysForRevocation')->with($user)->once()->andReturn(collect([$key])); - $this->daemonRepository->shouldReceive('setNode')->with($node)->once()->andReturnSelf(); - $this->daemonRepository->shouldReceive('revokeAccessKey')->with([$key->secret])->once()->andReturn(new Response); - - $this->repository->shouldReceive('deleteKeys')->with([$key->id])->once()->andReturnNull(); - - $this->getService()->handle($user); - $this->assertTrue(true); - } - - /** - * Test that an exception thrown by a call to the daemon is handled. - * - * @expectedException \Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException - */ - public function testExceptionThrownFromDaemonCallIsHandled() - { - $this->configureExceptionMock(); - - $user = factory(User::class)->make(); - $node = factory(Node::class)->make(); - $key = factory(DaemonKey::class)->make(['user_id' => $user->id]); - $key->setRelation('node', $node); - - $this->repository->shouldReceive('getKeysForRevocation')->with($user)->once()->andReturn(collect([$key])); - $this->daemonRepository->shouldReceive('setNode->revokeAccessKey')->with([$key->secret])->once()->andThrow($this->getExceptionMock()); - - $this->getService()->handle($user); - } - - /** - * Test that the behavior for handling exceptions that should not be thrown - * immediately is working correctly and adds them to the array. - */ - public function testIgnoredExceptionsAreHandledProperly() - { - $this->configureExceptionMock(); - - $user = factory(User::class)->make(); - $node = factory(Node::class)->make(); - $key = factory(DaemonKey::class)->make(['user_id' => $user->id]); - $key->setRelation('node', $node); - - $this->repository->shouldReceive('getKeysForRevocation')->with($user)->once()->andReturn(collect([$key])); - $this->daemonRepository->shouldReceive('setNode->revokeAccessKey')->with([$key->secret])->once()->andThrow($this->getExceptionMock()); - - $this->repository->shouldReceive('deleteKeys')->with([$key->id])->once()->andReturnNull(); - - $service = $this->getService(); - $service->handle($user, true); - $this->assertNotEmpty($service->getExceptions()); - $this->assertArrayHasKey($node->id, $service->getExceptions()); - $this->assertSame(array_get($service->getExceptions(), $node->id), $this->getExceptionMock()); - $this->assertTrue(true); - } - - /** - * Return an instance of the service for testing. - * - * @return \Pterodactyl\Services\DaemonKeys\RevokeMultipleDaemonKeysService - */ - private function getService(): RevokeMultipleDaemonKeysService - { - return new RevokeMultipleDaemonKeysService($this->repository, $this->daemonRepository); - } -}