diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 593189db..8eaed6c3 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -2,8 +2,8 @@ namespace Pterodactyl\Http\Controllers\Auth; -use Cake\Chronos\Chronos; use Illuminate\Support\Str; +use Carbon\CarbonImmutable; use Illuminate\Http\Request; use Illuminate\Auth\AuthManager; use Illuminate\Http\JsonResponse; @@ -101,7 +101,7 @@ class LoginController extends AbstractLoginController if ($user->use_totp) { $token = Str::random(64); - $this->cache->put($token, $user->id, Chronos::now()->addMinutes(5)); + $this->cache->put($token, $user->id, CarbonImmutable::now()->addMinutes(5)); return new JsonResponse([ 'data' => [ diff --git a/app/Http/Middleware/Api/AuthenticateKey.php b/app/Http/Middleware/Api/AuthenticateKey.php index 515cc1fc..6256a1ba 100644 --- a/app/Http/Middleware/Api/AuthenticateKey.php +++ b/app/Http/Middleware/Api/AuthenticateKey.php @@ -3,7 +3,7 @@ namespace Pterodactyl\Http\Middleware\Api; use Closure; -use Cake\Chronos\Chronos; +use Carbon\CarbonImmutable; use Illuminate\Http\Request; use Pterodactyl\Models\User; use Pterodactyl\Models\ApiKey; @@ -110,7 +110,7 @@ class AuthenticateKey throw new AccessDeniedHttpException; } - $this->repository->withoutFreshModel()->update($model->id, ['last_used_at' => Chronos::now()]); + $this->repository->withoutFreshModel()->update($model->id, ['last_used_at' => CarbonImmutable::now()]); return $model; } diff --git a/app/Models/DatabaseHost.php b/app/Models/DatabaseHost.php index 750ca0de..59471fce 100644 --- a/app/Models/DatabaseHost.php +++ b/app/Models/DatabaseHost.php @@ -2,6 +2,18 @@ namespace Pterodactyl\Models; +/** + * @property int $id + * @property string $name + * @property string $host + * @property int $port + * @property string $username + * @property string $password + * @property int|null $max_databases + * @property int|null $node_id + * @property \Carbon\CarbonImmutable $created_at + * @property \Carbon\CarbonImmutable $updated_at + */ class DatabaseHost extends Model { /** @@ -10,6 +22,11 @@ class DatabaseHost extends Model */ const RESOURCE_NAME = 'database_host'; + /** + * @var bool + */ + protected $immutableDates = true; + /** * The table associated with the model. * diff --git a/app/Providers/BladeServiceProvider.php b/app/Providers/BladeServiceProvider.php index 97b0df48..16a17a37 100644 --- a/app/Providers/BladeServiceProvider.php +++ b/app/Providers/BladeServiceProvider.php @@ -13,7 +13,7 @@ class BladeServiceProvider extends ServiceProvider { $this->app->make('blade.compiler') ->directive('datetimeHuman', function ($expression) { - return "setTimezone(config('app.timezone'))->toDateTimeString(); ?>"; + return "setTimezone(config('app.timezone'))->toDateTimeString(); ?>"; }); } } diff --git a/app/Transformers/Api/Application/BaseTransformer.php b/app/Transformers/Api/Application/BaseTransformer.php index 563dd086..79f1b0c4 100644 --- a/app/Transformers/Api/Application/BaseTransformer.php +++ b/app/Transformers/Api/Application/BaseTransformer.php @@ -2,7 +2,7 @@ namespace Pterodactyl\Transformers\Api\Application; -use Cake\Chronos\Chronos; +use Carbon\CarbonImmutable; use Pterodactyl\Models\ApiKey; use Illuminate\Container\Container; use Illuminate\Database\Eloquent\Model; @@ -107,7 +107,7 @@ abstract class BaseTransformer extends TransformerAbstract */ protected function formatTimestamp(string $timestamp): string { - return Chronos::createFromFormat(Chronos::DEFAULT_TO_STRING_FORMAT, $timestamp) + return CarbonImmutable::createFromFormat(CarbonImmutable::DEFAULT_TO_STRING_FORMAT, $timestamp) ->setTimezone(self::RESPONSE_TIMEZONE) ->toIso8601String(); } diff --git a/app/Transformers/Api/Application/DatabaseHostTransformer.php b/app/Transformers/Api/Application/DatabaseHostTransformer.php index 3ef10e8a..adbc8834 100644 --- a/app/Transformers/Api/Application/DatabaseHostTransformer.php +++ b/app/Transformers/Api/Application/DatabaseHostTransformer.php @@ -2,7 +2,6 @@ namespace Pterodactyl\Transformers\Api\Application; -use Cake\Chronos\Chronos; use Pterodactyl\Models\Database; use Pterodactyl\Models\DatabaseHost; use Pterodactyl\Services\Acl\Api\AdminAcl; @@ -41,12 +40,8 @@ class DatabaseHostTransformer extends BaseTransformer 'port' => $model->port, 'username' => $model->username, 'node' => $model->node_id, - 'created_at' => Chronos::createFromFormat(Chronos::DEFAULT_TO_STRING_FORMAT, $model->created_at) - ->setTimezone(config('app.timezone')) - ->toIso8601String(), - 'updated_at' => Chronos::createFromFormat(Chronos::DEFAULT_TO_STRING_FORMAT, $model->updated_at) - ->setTimezone(config('app.timezone')) - ->toIso8601String(), + 'created_at' => $model->created_at->toIso8601String(), + 'updated_at' => $model->updated_at->toIso8601String(), ]; } diff --git a/app/Transformers/Api/Application/ServerDatabaseTransformer.php b/app/Transformers/Api/Application/ServerDatabaseTransformer.php index dd238375..ad984626 100644 --- a/app/Transformers/Api/Application/ServerDatabaseTransformer.php +++ b/app/Transformers/Api/Application/ServerDatabaseTransformer.php @@ -2,7 +2,6 @@ namespace Pterodactyl\Transformers\Api\Application; -use Cake\Chronos\Chronos; use Pterodactyl\Models\Database; use Pterodactyl\Models\DatabaseHost; use Pterodactyl\Services\Acl\Api\AdminAcl; @@ -56,12 +55,8 @@ class ServerDatabaseTransformer extends BaseTransformer 'username' => $model->username, 'remote' => $model->remote, 'max_connections' => $model->max_connections, - 'created_at' => Chronos::createFromFormat(Chronos::DEFAULT_TO_STRING_FORMAT, $model->created_at) - ->setTimezone(config('app.timezone')) - ->toIso8601String(), - 'updated_at' => Chronos::createFromFormat(Chronos::DEFAULT_TO_STRING_FORMAT, $model->updated_at) - ->setTimezone(config('app.timezone')) - ->toIso8601String(), + 'created_at' => $model->created_at->toIso8601String(), + 'updated_at' => $model->updated_at->toIso8601String(), ]; } diff --git a/bootstrap/app.php b/bootstrap/app.php index f35c1592..ee5f1bae 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -12,7 +12,7 @@ */ $app = new Illuminate\Foundation\Application( - realpath(__DIR__ . '/../') + $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__) ); /* diff --git a/bootstrap/tests.php b/bootstrap/tests.php index e2233462..8b76cfc2 100644 --- a/bootstrap/tests.php +++ b/bootstrap/tests.php @@ -1,5 +1,6 @@ make(Kernel::class); */ $kernel->bootstrap(); +// Register the collision service provider so that errors during the test +// setup process are output nicely. +(new Provider)->register(); + $output = new ConsoleOutput; if (config('database.default') !== 'testing') { diff --git a/composer.json b/composer.json index 045e4b84..343f50ed 100644 --- a/composer.json +++ b/composer.json @@ -16,10 +16,7 @@ "ext-mbstring": "*", "ext-pdo_mysql": "*", "ext-zip": "*", - "appstract/laravel-blade-directives": "^1.11", "aws/aws-sdk-php": "^3.171", - "cakephp/chronos": "^1.3", - "codedungeon/phpunit-result-printer": "^0.30.1", "doctrine/dbal": "^2.12", "fideloper/proxy": "^4.4", "guzzlehttp/guzzle": "^7.2", @@ -36,7 +33,6 @@ "pragmarx/google2fa": "^5.0", "predis/predis": "^1.1", "prologue/alerts": "^0.4", - "psy/psysh": "^0.10", "s1lentium/iptools": "^1.1", "spatie/laravel-fractal": "^5.8", "spatie/laravel-query-builder": "^3.3", @@ -49,7 +45,7 @@ "barryvdh/laravel-ide-helper": "^2.9", "facade/ignition": "^2.5", "fakerphp/faker": "^1.13", - "friendsofphp/php-cs-fixer": "^2.17", + "friendsofphp/php-cs-fixer": "^2.18", "laravel/dusk": "^6.11", "mockery/mockery": "^1.4", "nunomaduro/collision": "^5.2", @@ -68,9 +64,7 @@ }, "autoload-dev": { "psr-4": { - "Pterodactyl\\Tests\\Browser\\": "tests/Browser", - "Pterodactyl\\Tests\\Integration\\": "tests/Integration", - "Tests\\": "tests/" + "Pterodactyl\\Tests\\": "tests/" } }, "scripts": { diff --git a/composer.lock b/composer.lock index 36fe810f..b710b41f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,127 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "18a158295556def258c4da81a571becd", + "content-hash": "ff65a88dee023a86598a10a5178c0165", "packages": [ - { - "name": "2bj/phanybar", - "version": "v1.0.0", - "source": { - "type": "git", - "url": "https://github.com/2bj/Phanybar.git", - "reference": "88ff671e18f30c2047a34f8cf2465a7ff93c819b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/2bj/Phanybar/zipball/88ff671e18f30c2047a34f8cf2465a7ff93c819b", - "reference": "88ff671e18f30c2047a34f8cf2465a7ff93c819b", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "bin": [ - "bin/phanybar" - ], - "type": "library", - "autoload": { - "psr-4": { - "Bakyt\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bakyt Turgumbaev", - "email": "dev2bj@gmail.com" - } - ], - "description": "Control AnyBar from your php", - "keywords": [ - "anybar", - "phanybar" - ], - "support": { - "issues": "https://github.com/2bj/Phanybar/issues", - "source": "https://github.com/2bj/Phanybar/tree/master" - }, - "time": "2015-03-06T12:14:28+00:00" - }, - { - "name": "appstract/laravel-blade-directives", - "version": "1.11.0", - "source": { - "type": "git", - "url": "https://github.com/appstract/laravel-blade-directives.git", - "reference": "8c269cf469ce356b9d69d1a90a763babbf67a3a7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/appstract/laravel-blade-directives/zipball/8c269cf469ce356b9d69d1a90a763babbf67a3a7", - "reference": "8c269cf469ce356b9d69d1a90a763babbf67a3a7", - "shasum": "" - }, - "require": { - "laravel/framework": "^5.7|^6.0|^7.0|^8.0", - "php": "^7.1.3|^8.0" - }, - "require-dev": { - "orchestra/testbench": "~3.7|^4.0|^5.0|^6.0" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Appstract\\BladeDirectives\\BladeDirectivesServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Appstract\\BladeDirectives\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gijs Jorissen", - "email": "gijs@appstract.nl", - "homepage": "https://appstract.nl", - "role": "Developer" - } - ], - "description": "Handy Blade directives", - "homepage": "https://github.com/appstract/laravel-blade-directives", - "keywords": [ - "appstract", - "laravel-blade-directives" - ], - "support": { - "issues": "https://github.com/appstract/laravel-blade-directives/issues", - "source": "https://github.com/appstract/laravel-blade-directives/tree/1.11.0" - }, - "time": "2021-01-08T09:34:32+00:00" - }, { "name": "aws/aws-sdk-php", - "version": "3.171.19", + "version": "3.172.0", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "e786e4a8b2ec85b258833d0570ff6b61348cbdb6" + "reference": "5a5e66c4d54c392042820703eeb8a6bd3d222924" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/e786e4a8b2ec85b258833d0570ff6b61348cbdb6", - "reference": "e786e4a8b2ec85b258833d0570ff6b61348cbdb6", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/5a5e66c4d54c392042820703eeb8a6bd3d222924", + "reference": "5a5e66c4d54c392042820703eeb8a6bd3d222924", "shasum": "" }, "require": { @@ -199,32 +92,32 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.171.19" + "source": "https://github.com/aws/aws-sdk-php/tree/3.172.0" }, - "time": "2021-01-15T19:26:11+00:00" + "time": "2021-01-22T19:21:38+00:00" }, { "name": "brick/math", - "version": "0.9.1", + "version": "0.9.2", "source": { "type": "git", "url": "https://github.com/brick/math.git", - "reference": "283a40c901101e66de7061bd359252c013dcc43c" + "reference": "dff976c2f3487d42c1db75a3b180e2b9f0e72ce0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/283a40c901101e66de7061bd359252c013dcc43c", - "reference": "283a40c901101e66de7061bd359252c013dcc43c", + "url": "https://api.github.com/repos/brick/math/zipball/dff976c2f3487d42c1db75a3b180e2b9f0e72ce0", + "reference": "dff976c2f3487d42c1db75a3b180e2b9f0e72ce0", "shasum": "" }, "require": { "ext-json": "*", - "php": "^7.1|^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^7.5.15|^8.5", - "vimeo/psalm": "^3.5" + "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.0", + "vimeo/psalm": "4.3.2" }, "type": "library", "autoload": { @@ -249,7 +142,7 @@ ], "support": { "issues": "https://github.com/brick/math/issues", - "source": "https://github.com/brick/math/tree/master" + "source": "https://github.com/brick/math/tree/0.9.2" }, "funding": [ { @@ -257,172 +150,7 @@ "type": "tidelift" } ], - "time": "2020-08-18T23:57:15+00:00" - }, - { - "name": "cakephp/chronos", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/cakephp/chronos.git", - "reference": "ba2bab98849e7bf29b02dd634ada49ab36472959" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/cakephp/chronos/zipball/ba2bab98849e7bf29b02dd634ada49ab36472959", - "reference": "ba2bab98849e7bf29b02dd634ada49ab36472959", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "athletic/athletic": "~0.1", - "cakephp/cakephp-codesniffer": "^3.0", - "phpbench/phpbench": "@dev", - "phpunit/phpunit": "<6.0 || ^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Cake\\Chronos\\": "src/" - }, - "files": [ - "src/carbon_compat.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Brian Nesbitt", - "email": "brian@nesbot.com", - "homepage": "http://nesbot.com" - }, - { - "name": "The CakePHP Team", - "homepage": "http://cakephp.org" - } - ], - "description": "A simple API extension for DateTime.", - "homepage": "http://cakephp.org", - "keywords": [ - "date", - "datetime", - "time" - ], - "support": { - "irc": "irc://irc.freenode.org/cakephp", - "issues": "https://github.com/cakephp/chronos/issues", - "source": "https://github.com/cakephp/chronos" - }, - "time": "2019-11-30T02:33:19+00:00" - }, - { - "name": "codedungeon/php-cli-colors", - "version": "1.12.2", - "source": { - "type": "git", - "url": "https://github.com/mikeerickson/php-cli-colors.git", - "reference": "e346156f75717140a3dd622124d2ec686aa7ff8e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mikeerickson/php-cli-colors/zipball/e346156f75717140a3dd622124d2ec686aa7ff8e", - "reference": "e346156f75717140a3dd622124d2ec686aa7ff8e", - "shasum": "" - }, - "require-dev": { - "phpunit/phpunit": ">=5.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "Codedungeon\\PHPCliColors\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike Erickson", - "email": "codedungeon@gmail.com" - } - ], - "description": "Liven up you PHP Console Apps with standard colors", - "homepage": "https://github.com/mikeerickson/php-cli-colors", - "keywords": [ - "color", - "colors", - "composer", - "package", - "php" - ], - "support": { - "issues": "https://github.com/mikeerickson/php-cli-colors/issues", - "source": "https://github.com/mikeerickson/php-cli-colors/tree/1.12.2" - }, - "time": "2021-01-05T04:48:27+00:00" - }, - { - "name": "codedungeon/phpunit-result-printer", - "version": "0.30.1", - "source": { - "type": "git", - "url": "https://github.com/mikeerickson/phpunit-pretty-result-printer.git", - "reference": "a361009eeb7078c1478ba835976f7722a4952870" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mikeerickson/phpunit-pretty-result-printer/zipball/a361009eeb7078c1478ba835976f7722a4952870", - "reference": "a361009eeb7078c1478ba835976f7722a4952870", - "shasum": "" - }, - "require": { - "2bj/phanybar": "^1.0", - "codedungeon/php-cli-colors": "^1.10.2", - "hassankhan/config": "^0.11.2|^1.0|^2.0", - "php": "^7.1 | ^8.0", - "symfony/yaml": "^2.7|^3.0|^4.0|^5.0" - }, - "require-dev": { - "spatie/phpunit-watcher": "^1.6" - }, - "type": "library", - "autoload": { - "psr-4": { - "Codedungeon\\PHPUnitPrettyResultPrinter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike Erickson", - "email": "codedungeon@gmail.com" - } - ], - "description": "PHPUnit Pretty Result Printer", - "keywords": [ - "TDD", - "composer", - "package", - "phpunit", - "printer", - "result-printer", - "testing" - ], - "support": { - "issues": "https://github.com/mikeerickson/phpunit-pretty-result-printer/issues", - "source": "https://github.com/mikeerickson/phpunit-pretty-result-printer/tree/0.30.1" - }, - "time": "2020-12-24T20:19:03+00:00" + "time": "2021-01-20T22:51:39+00:00" }, { "name": "dnoegel/php-xdg-base-dir", @@ -1496,67 +1224,6 @@ }, "time": "2020-11-26T19:24:33+00:00" }, - { - "name": "hassankhan/config", - "version": "0.11.2", - "source": { - "type": "git", - "url": "https://github.com/hassankhan/config.git", - "reference": "7fbc236c32dc6cc53a7b00992a2739cf8b41c085" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hassankhan/config/zipball/7fbc236c32dc6cc53a7b00992a2739cf8b41c085", - "reference": "7fbc236c32dc6cc53a7b00992a2739cf8b41c085", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0", - "scrutinizer/ocular": "~1.1", - "squizlabs/php_codesniffer": "~2.2" - }, - "suggest": { - "symfony/yaml": "~2.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Noodlehaus\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Hassan Khan", - "homepage": "http://hassankhan.me/", - "role": "Developer" - } - ], - "description": "Lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files", - "homepage": "http://hassankhan.me/config/", - "keywords": [ - "config", - "configuration", - "ini", - "json", - "microphp", - "unframework", - "xml", - "yaml", - "yml" - ], - "support": { - "issues": "https://github.com/hassankhan/config/issues", - "source": "https://github.com/hassankhan/config/tree/0.11.2" - }, - "time": "2017-11-07T22:49:43+00:00" - }, { "name": "laracasts/utilities", "version": "3.2", @@ -1620,16 +1287,16 @@ }, { "name": "laravel/framework", - "version": "v8.22.1", + "version": "v8.24.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "5c70991b96c5722afed541a996479b5112654c8b" + "reference": "d16e9f875e4d7609a05d5007393e22ba95efd1fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/5c70991b96c5722afed541a996479b5112654c8b", - "reference": "5c70991b96c5722afed541a996479b5112654c8b", + "url": "https://api.github.com/repos/laravel/framework/zipball/d16e9f875e4d7609a05d5007393e22ba95efd1fc", + "reference": "d16e9f875e4d7609a05d5007393e22ba95efd1fc", "shasum": "" }, "require": { @@ -1783,7 +1450,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-01-13T13:37:56+00:00" + "time": "2021-01-21T14:19:29+00:00" }, { "name": "laravel/helpers", @@ -2476,16 +2143,16 @@ }, { "name": "league/mime-type-detection", - "version": "1.5.1", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "353f66d7555d8a90781f6f5e7091932f9a4250aa" + "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/353f66d7555d8a90781f6f5e7091932f9a4250aa", - "reference": "353f66d7555d8a90781f6f5e7091932f9a4250aa", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", + "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", "shasum": "" }, "require": { @@ -2493,8 +2160,9 @@ "php": "^7.2 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.36", - "phpunit/phpunit": "^8.5.8" + "friendsofphp/php-cs-fixer": "^2.18", + "phpstan/phpstan": "^0.12.68", + "phpunit/phpunit": "^8.5.8 || ^9.3" }, "type": "library", "autoload": { @@ -2515,7 +2183,7 @@ "description": "Mime-type detection for Flysystem", "support": { "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.5.1" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.7.0" }, "funding": [ { @@ -2527,7 +2195,7 @@ "type": "tidelift" } ], - "time": "2020-10-18T11:50:25+00:00" + "time": "2021-01-18T20:58:21+00:00" }, { "name": "matriphe/iso-639", @@ -3654,16 +3322,16 @@ }, { "name": "psy/psysh", - "version": "v0.10.5", + "version": "v0.10.6", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "7c710551d4a2653afa259c544508dc18a9098956" + "reference": "6f990c19f91729de8b31e639d6e204ea59f19cf3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/7c710551d4a2653afa259c544508dc18a9098956", - "reference": "7c710551d4a2653afa259c544508dc18a9098956", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/6f990c19f91729de8b31e639d6e204ea59f19cf3", + "reference": "6f990c19f91729de8b31e639d6e204ea59f19cf3", "shasum": "" }, "require": { @@ -3692,7 +3360,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "0.10.x-dev" + "dev-main": "0.10.x-dev" } }, "autoload": { @@ -3724,9 +3392,9 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.10.5" + "source": "https://github.com/bobthecow/psysh/tree/v0.10.6" }, - "time": "2020-12-04T02:51:30+00:00" + "time": "2021-01-18T15:53:43+00:00" }, { "name": "ralouphie/getallheaders", @@ -3774,16 +3442,16 @@ }, { "name": "ramsey/collection", - "version": "1.1.1", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/ramsey/collection.git", - "reference": "24d93aefb2cd786b7edd9f45b554aea20b28b9b1" + "reference": "28a5c4ab2f5111db6a60b2b4ec84057e0f43b9c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/collection/zipball/24d93aefb2cd786b7edd9f45b554aea20b28b9b1", - "reference": "24d93aefb2cd786b7edd9f45b554aea20b28b9b1", + "url": "https://api.github.com/repos/ramsey/collection/zipball/28a5c4ab2f5111db6a60b2b4ec84057e0f43b9c1", + "reference": "28a5c4ab2f5111db6a60b2b4ec84057e0f43b9c1", "shasum": "" }, "require": { @@ -3793,19 +3461,19 @@ "captainhook/captainhook": "^5.3", "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "ergebnis/composer-normalize": "^2.6", - "fzaninotto/faker": "^1.5", + "fakerphp/faker": "^1.5", "hamcrest/hamcrest-php": "^2", - "jangregor/phpstan-prophecy": "^0.6", + "jangregor/phpstan-prophecy": "^0.8", "mockery/mockery": "^1.3", "phpstan/extension-installer": "^1", "phpstan/phpstan": "^0.12.32", "phpstan/phpstan-mockery": "^0.12.5", "phpstan/phpstan-phpunit": "^0.12.11", - "phpunit/phpunit": "^8.5", + "phpunit/phpunit": "^8.5 || ^9", "psy/psysh": "^0.10.4", "slevomat/coding-standard": "^6.3", "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^3.12.2" + "vimeo/psalm": "^4.4" }, "type": "library", "autoload": { @@ -3835,15 +3503,19 @@ ], "support": { "issues": "https://github.com/ramsey/collection/issues", - "source": "https://github.com/ramsey/collection/tree/1.1.1" + "source": "https://github.com/ramsey/collection/tree/1.1.3" }, "funding": [ { "url": "https://github.com/ramsey", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", + "type": "tidelift" } ], - "time": "2020-09-10T20:58:17+00:00" + "time": "2021-01-21T17:40:04+00:00" }, { "name": "ramsey/uuid", @@ -6693,16 +6365,16 @@ }, { "name": "vlucas/phpdotenv", - "version": "v5.2.0", + "version": "v5.3.0", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "fba64139db67123c7a57072e5f8d3db10d160b66" + "reference": "b3eac5c7ac896e52deab4a99068e3f4ab12d9e56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/fba64139db67123c7a57072e5f8d3db10d160b66", - "reference": "fba64139db67123c7a57072e5f8d3db10d160b66", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/b3eac5c7ac896e52deab4a99068e3f4ab12d9e56", + "reference": "b3eac5c7ac896e52deab4a99068e3f4ab12d9e56", "shasum": "" }, "require": { @@ -6717,7 +6389,7 @@ "require-dev": { "bamarni/composer-bin-plugin": "^1.4.1", "ext-filter": "*", - "phpunit/phpunit": "^7.5.20 || ^8.5.2 || ^9.0" + "phpunit/phpunit": "^7.5.20 || ^8.5.14 || ^9.5.1" }, "suggest": { "ext-filter": "Required to use the boolean validator." @@ -6725,7 +6397,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.2-dev" + "dev-master": "5.3-dev" } }, "autoload": { @@ -6757,7 +6429,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.2.0" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.3.0" }, "funding": [ { @@ -6769,7 +6441,7 @@ "type": "tidelift" } ], - "time": "2020-09-14T15:57:31+00:00" + "time": "2021-01-20T15:23:13+00:00" }, { "name": "voku/portable-ascii", @@ -6850,12 +6522,12 @@ "version": "1.9.1", "source": { "type": "git", - "url": "https://github.com/webmozart/assert.git", + "url": "https://github.com/webmozarts/assert.git", "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", "shasum": "" }, @@ -6893,8 +6565,8 @@ "validate" ], "support": { - "issues": "https://github.com/webmozart/assert/issues", - "source": "https://github.com/webmozart/assert/tree/master" + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.9.1" }, "time": "2020-07-08T17:02:28+00:00" } @@ -7973,16 +7645,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.17.3", + "version": "v2.18.1", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "bd32f5dd72cdfc7b53f54077f980e144bfa2f595" + "reference": "c68ff6231adb276857761e43b7ed082f164dce0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/bd32f5dd72cdfc7b53f54077f980e144bfa2f595", - "reference": "bd32f5dd72cdfc7b53f54077f980e144bfa2f595", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/c68ff6231adb276857761e43b7ed082f164dce0b", + "reference": "c68ff6231adb276857761e43b7ed082f164dce0b", "shasum": "" }, "require": { @@ -8004,7 +7676,6 @@ "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0" }, "require-dev": { - "johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0", "justinrainbow/json-schema": "^5.0", "keradus/cli-executor": "^1.4", "mikey179/vfsstream": "^1.6", @@ -8013,11 +7684,11 @@ "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", "phpspec/prophecy-phpunit": "^1.1 || ^2.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.4.4 <9.5", + "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.5", "phpunitgoodpractices/polyfill": "^1.5", "phpunitgoodpractices/traits": "^1.9.1", "sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1", - "symfony/phpunit-bridge": "^5.1", + "symfony/phpunit-bridge": "^5.2.1", "symfony/yaml": "^3.0 || ^4.0 || ^5.0" }, "suggest": { @@ -8065,7 +7736,7 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.17.3" + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.18.1" }, "funding": [ { @@ -8073,7 +7744,7 @@ "type": "github" } ], - "time": "2020-12-24T11:14:44+00:00" + "time": "2021-01-21T18:50:42+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -8198,16 +7869,16 @@ }, { "name": "laravel/dusk", - "version": "v6.11.0", + "version": "v6.11.1", "source": { "type": "git", "url": "https://github.com/laravel/dusk.git", - "reference": "7e05b3ca4f17afcba528c4c5a2390a2dd9949b38" + "reference": "2fb73c87b5805ced07e8ab4487b3c1ace0b65ae9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/dusk/zipball/7e05b3ca4f17afcba528c4c5a2390a2dd9949b38", - "reference": "7e05b3ca4f17afcba528c4c5a2390a2dd9949b38", + "url": "https://api.github.com/repos/laravel/dusk/zipball/2fb73c87b5805ced07e8ab4487b3c1ace0b65ae9", + "reference": "2fb73c87b5805ced07e8ab4487b3c1ace0b65ae9", "shasum": "" }, "require": { @@ -8264,22 +7935,22 @@ ], "support": { "issues": "https://github.com/laravel/dusk/issues", - "source": "https://github.com/laravel/dusk/tree/v6.11.0" + "source": "https://github.com/laravel/dusk/tree/v6.11.1" }, - "time": "2020-12-22T16:57:45+00:00" + "time": "2021-01-19T14:58:07+00:00" }, { "name": "maximebf/debugbar", - "version": "v1.16.4", + "version": "v1.16.5", "source": { "type": "git", "url": "https://github.com/maximebf/php-debugbar.git", - "reference": "c86c717e4bf3c6d98422da5c38bfa7b0f494b04c" + "reference": "6d51ee9e94cff14412783785e79a4e7ef97b9d62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/c86c717e4bf3c6d98422da5c38bfa7b0f494b04c", - "reference": "c86c717e4bf3c6d98422da5c38bfa7b0f494b04c", + "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/6d51ee9e94cff14412783785e79a4e7ef97b9d62", + "reference": "6d51ee9e94cff14412783785e79a4e7ef97b9d62", "shasum": "" }, "require": { @@ -8329,9 +8000,9 @@ ], "support": { "issues": "https://github.com/maximebf/php-debugbar/issues", - "source": "https://github.com/maximebf/php-debugbar/tree/v1.16.4" + "source": "https://github.com/maximebf/php-debugbar/tree/v1.16.5" }, - "time": "2020-12-07T10:48:48+00:00" + "time": "2020-12-07T11:07:24+00:00" }, { "name": "mockery/mockery", @@ -9523,16 +9194,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.0", + "version": "9.5.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "8e16c225d57c3d6808014df6b1dd7598d0a5bbbe" + "reference": "e7bdf4085de85a825f4424eae52c99a1cec2f360" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8e16c225d57c3d6808014df6b1dd7598d0a5bbbe", - "reference": "8e16c225d57c3d6808014df6b1dd7598d0a5bbbe", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e7bdf4085de85a825f4424eae52c99a1cec2f360", + "reference": "e7bdf4085de85a825f4424eae52c99a1cec2f360", "shasum": "" }, "require": { @@ -9610,7 +9281,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.0" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.1" }, "funding": [ { @@ -9622,7 +9293,7 @@ "type": "github" } ], - "time": "2020-12-04T05:05:53+00:00" + "time": "2021-01-17T07:42:25+00:00" }, { "name": "react/promise", diff --git a/phpunit.xml b/phpunit.xml index f6bc3b15..227dadb9 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -8,7 +8,7 @@ convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" - printerClass="Codedungeon\PHPUnitPrettyResultPrinter\Printer" + printerClass="NunoMaduro\Collision\Adapters\Phpunit\Printer" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" diff --git a/tests/Assertions/CommandAssertionsTrait.php b/tests/Assertions/CommandAssertionsTrait.php index bf88daa9..a6cc12f8 100644 --- a/tests/Assertions/CommandAssertionsTrait.php +++ b/tests/Assertions/CommandAssertionsTrait.php @@ -7,7 +7,7 @@ * https://opensource.org/licenses/MIT */ -namespace Tests\Assertions; +namespace Pterodactyl\Tests\Assertions; use PHPUnit\Framework\Assert; diff --git a/tests/Assertions/ControllerAssertionsTrait.php b/tests/Assertions/ControllerAssertionsTrait.php index 16cfcdd9..dbf76419 100644 --- a/tests/Assertions/ControllerAssertionsTrait.php +++ b/tests/Assertions/ControllerAssertionsTrait.php @@ -7,7 +7,7 @@ * https://opensource.org/licenses/MIT */ -namespace Tests\Assertions; +namespace Pterodactyl\Tests\Assertions; use Illuminate\View\View; use Illuminate\Http\Response; diff --git a/tests/Assertions/MiddlewareAttributeAssertionsTrait.php b/tests/Assertions/MiddlewareAttributeAssertionsTrait.php index fb8f7008..2e84999e 100644 --- a/tests/Assertions/MiddlewareAttributeAssertionsTrait.php +++ b/tests/Assertions/MiddlewareAttributeAssertionsTrait.php @@ -1,6 +1,6 @@ generateTestAccount(); diff --git a/tests/Integration/IntegrationTestCase.php b/tests/Integration/IntegrationTestCase.php index ee722966..5fc2d9f4 100644 --- a/tests/Integration/IntegrationTestCase.php +++ b/tests/Integration/IntegrationTestCase.php @@ -2,10 +2,10 @@ namespace Pterodactyl\Tests\Integration; -use Tests\TestCase; -use Cake\Chronos\Chronos; +use Pterodactyl\Tests\TestCase; +use Carbon\CarbonImmutable; use Illuminate\Database\Eloquent\Model; -use Tests\Traits\Integration\CreatesTestModels; +use Pterodactyl\Tests\Traits\Integration\CreatesTestModels; use Pterodactyl\Transformers\Api\Application\BaseTransformer; abstract class IntegrationTestCase extends TestCase @@ -42,7 +42,7 @@ abstract class IntegrationTestCase extends TestCase */ protected function formatTimestamp(string $timestamp): string { - return Chronos::createFromFormat(Chronos::DEFAULT_TO_STRING_FORMAT, $timestamp) + return CarbonImmutable::createFromFormat(CarbonImmutable::DEFAULT_TO_STRING_FORMAT, $timestamp) ->setTimezone(BaseTransformer::RESPONSE_TIMEZONE) ->toIso8601String(); } diff --git a/tests/TestCase.php b/tests/TestCase.php index 768c09fe..5e131fa8 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -1,8 +1,9 @@ . - * - * This software is licensed under the terms of the MIT license. - * https://opensource.org/licenses/MIT - */ -namespace Tests\Unit\Helpers; +namespace Pterodactyl\Tests\Unit\Helpers; -use Tests\TestCase; +use Pterodactyl\Tests\TestCase; class IsDigitTest extends TestCase { diff --git a/tests/Unit/Http/Middleware/AdminAuthenticateTest.php b/tests/Unit/Http/Middleware/AdminAuthenticateTest.php index c56ac4d4..8e63ff09 100644 --- a/tests/Unit/Http/Middleware/AdminAuthenticateTest.php +++ b/tests/Unit/Http/Middleware/AdminAuthenticateTest.php @@ -1,6 +1,6 @@ auth = m::mock(AuthManager::class); $this->encrypter = m::mock(Encrypter::class); @@ -90,7 +89,7 @@ class AuthenticateKeyTest extends MiddlewareTestCase $this->auth->shouldReceive('guard->loginUsingId')->with($model->user_id)->once()->andReturnNull(); $this->repository->shouldReceive('withoutFreshModel->update')->with($model->id, [ - 'last_used_at' => Chronos::now(), + 'last_used_at' => CarbonImmutable::now(), ])->once()->andReturnNull(); $this->getMiddleware()->handle($this->request, $this->getClosureAssertions(), ApiKey::TYPE_APPLICATION); @@ -113,7 +112,7 @@ class AuthenticateKeyTest extends MiddlewareTestCase $this->auth->shouldReceive('guard->loginUsingId')->with($model->user_id)->once()->andReturnNull(); $this->repository->shouldReceive('withoutFreshModel->update')->with($model->id, [ - 'last_used_at' => Chronos::now(), + 'last_used_at' => CarbonImmutable::now(), ])->once()->andReturnNull(); $this->getMiddleware()->handle($this->request, $this->getClosureAssertions(), ApiKey::TYPE_ACCOUNT); diff --git a/tests/Unit/Http/Middleware/Api/Daemon/DaemonAuthenticateTest.php b/tests/Unit/Http/Middleware/Api/Daemon/DaemonAuthenticateTest.php index dff1c154..d00c019a 100644 --- a/tests/Unit/Http/Middleware/Api/Daemon/DaemonAuthenticateTest.php +++ b/tests/Unit/Http/Middleware/Api/Daemon/DaemonAuthenticateTest.php @@ -1,11 +1,11 @@