diff --git a/app/Models/Player.php b/app/Models/Player.php index 4d73f5e4..f716017f 100644 --- a/app/Models/Player.php +++ b/app/Models/Player.php @@ -5,6 +5,7 @@ namespace App\Models; use App\Events\PlayerProfileUpdated; use App\Models; use DateTimeInterface; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Carbon; use Lorisleiva\LaravelSearchString\Concerns\SearchString; @@ -23,6 +24,7 @@ use Lorisleiva\LaravelSearchString\Concerns\SearchString; */ class Player extends Model { + use HasFactory; use SearchString; public const CREATED_AT = null; diff --git a/app/Models/Texture.php b/app/Models/Texture.php index bd45cd82..6419af8d 100644 --- a/app/Models/Texture.php +++ b/app/Models/Texture.php @@ -4,6 +4,7 @@ namespace App\Models; use DateTimeInterface; use Illuminate\Database\Eloquent\Collection; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Carbon; @@ -23,6 +24,8 @@ use Illuminate\Support\Carbon; */ class Texture extends Model { + use HasFactory; + public $primaryKey = 'tid'; public const CREATED_AT = 'upload_at'; public const UPDATED_AT = null; diff --git a/app/Models/User.php b/app/Models/User.php index 95208443..cf060875 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -4,6 +4,7 @@ namespace App\Models; use App\Models\Concerns\HasPassword; use Illuminate\Database\Eloquent\Collection; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Laravel\Passport\HasApiTokens; @@ -30,6 +31,7 @@ use Tymon\JWTAuth\Contracts\JWTSubject; class User extends Authenticatable implements JWTSubject { use Notifiable; + use HasFactory; use HasPassword; use HasApiTokens; use SearchString; diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 7927f776..9040af4e 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -4,6 +4,7 @@ namespace App\Providers; use App\Services; use Illuminate\Http\Request; +use Illuminate\Pagination\Paginator; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider @@ -18,6 +19,8 @@ class AppServiceProvider extends ServiceProvider public function boot(Request $request) { + Paginator::useBootstrap(); + $this->configureUrlGenerator($request); } diff --git a/composer.json b/composer.json index 7680b70e..1cbc6674 100644 --- a/composer.json +++ b/composer.json @@ -24,36 +24,33 @@ "gregwar/captcha": "1.*", "guzzlehttp/guzzle": "^7.0", "intervention/image": "^2.5", - "laravel/framework": "^7.0", - "laravel/passport": "^9.2", - "lorisleiva/laravel-search-string": "^0.1.6", + "laravel/framework": "^8.0", + "laravel/passport": "^10.0", + "lorisleiva/laravel-search-string": "^1.0", "nesbot/carbon": "^2.0", - "nunomaduro/collision": "^4.1", - "rcrowe/twigbridge": "^0.11.3", + "nunomaduro/collision": "^5.0", + "rcrowe/twigbridge": "^0.12", "spatie/laravel-translation-loader": "^2.6", "symfony/process": "^5.0", "symfony/yaml": "^5.0", "twig/twig": "^2.11", - "tymon/jwt-auth": "dev-develop", + "tymon/jwt-auth": "^1.0", "vectorface/whip": "^0.3.2" }, "require-dev": { - "barryvdh/laravel-debugbar": "^3.2", + "barryvdh/laravel-debugbar": "^3.5", "fzaninotto/faker": "~1.9", - "laravel/browser-kit-testing": "^6.0", - "laravel/tinker": "^2.2", - "mockery/mockery": "1.3.*", + "laravel/browser-kit-testing": "^6.1", + "laravel/tinker": "^2.4", + "mockery/mockery": "^1.4", "phpunit/phpunit": "^9.4", "symfony/css-selector": "^5.0", "symfony/dom-crawler": "^5.0" }, "autoload": { - "classmap": [ - "app/Models", - "database" - ], "psr-4": { - "App\\": "app/" + "App\\": "app/", + "Database\\Factories\\": "database/factories/" }, "files": [ "app/helpers.php" diff --git a/composer.lock b/composer.lock index 9c765b3e..521ec02f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,28 +4,28 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6fac946f0375f24d2dc8a8a850b2b918", + "content-hash": "550bb66ca01d0b4638d154cae44fd0d8", "packages": [ { "name": "blessing/filter", - "version": "v1.1.1", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/bs-community/filter.git", - "reference": "a3c1bf24f4f0fb2e8c87c60f32324894e85c9341" + "reference": "b2e48bcb852bdc92cee39f2188e32550f95be8d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bs-community/filter/zipball/a3c1bf24f4f0fb2e8c87c60f32324894e85c9341", - "reference": "a3c1bf24f4f0fb2e8c87c60f32324894e85c9341", + "url": "https://api.github.com/repos/bs-community/filter/zipball/b2e48bcb852bdc92cee39f2188e32550f95be8d2", + "reference": "b2e48bcb852bdc92cee39f2188e32550f95be8d2", "shasum": "" }, "require": { - "illuminate/contracts": "6.* || 7.*", - "illuminate/support": "6.* || 7.*" + "illuminate/contracts": "^6 || ^7 || ^8", + "illuminate/support": "^6 || ^7 || ^8" }, "require-dev": { - "illuminate/container": "6.* || 7.*", + "illuminate/container": "^6 || ^7 || ^8", "phpunit/phpunit": "~9.0" }, "type": "library", @@ -57,24 +57,24 @@ "laravel", "wordpress" ], - "time": "2020-04-23T06:50:46+00:00" + "time": "2020-10-14T02:29:54+00:00" }, { "name": "blessing/rejection", - "version": "v1.1.0", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/bs-community/rejection.git", - "reference": "1f8e94d2030c5f4133436df80fbaed42441bc5b1" + "reference": "2de752ba7793060ae7bc6607d885a8be2be2e08c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bs-community/rejection/zipball/1f8e94d2030c5f4133436df80fbaed42441bc5b1", - "reference": "1f8e94d2030c5f4133436df80fbaed42441bc5b1", + "url": "https://api.github.com/repos/bs-community/rejection/zipball/2de752ba7793060ae7bc6607d885a8be2be2e08c", + "reference": "2de752ba7793060ae7bc6607d885a8be2be2e08c", "shasum": "" }, "require": { - "illuminate/support": "6.* || 7.*" + "illuminate/support": "^6 || ^7 || ^8" }, "require-dev": { "phpunit/phpunit": "~9.0" @@ -96,7 +96,7 @@ } ], "description": "Rejection is an object that indicates you are rejecting.", - "time": "2020-03-04T01:46:31+00:00" + "time": "2020-10-14T02:32:06+00:00" }, { "name": "blessing/texture-renderer", @@ -859,30 +859,29 @@ }, { "name": "dragonmantank/cron-expression", - "version": "v2.3.1", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/dragonmantank/cron-expression.git", - "reference": "65b2d8ee1f10915efb3b55597da3404f096acba2" + "reference": "48212cdc0a79051d50d7fc2f0645c5a321caf926" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/65b2d8ee1f10915efb3b55597da3404f096acba2", - "reference": "65b2d8ee1f10915efb3b55597da3404f096acba2", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/48212cdc0a79051d50d7fc2f0645c5a321caf926", + "reference": "48212cdc0a79051d50d7fc2f0645c5a321caf926", "shasum": "" }, "require": { - "php": "^7.0|^8.0" + "php": "^7.1|^8.0" + }, + "replace": { + "mtdowling/cron-expression": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^6.4|^7.0|^8.0|^9.0" + "phpstan/phpstan": "^0.11|^0.12", + "phpunit/phpunit": "^7.0|^8.0|^9.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, "autoload": { "psr-4": { "Cron\\": "src/Cron/" @@ -893,11 +892,6 @@ "MIT" ], "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, { "name": "Chris Tankersley", "email": "chris@ctankersley.com", @@ -915,7 +909,7 @@ "type": "github" } ], - "time": "2020-10-13T00:52:37+00:00" + "time": "2020-10-13T01:26:01+00:00" }, { "name": "egulias/email-validator", @@ -1268,6 +1262,68 @@ ], "time": "2020-03-25T18:49:23+00:00" }, + { + "name": "graham-campbell/result-type", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/GrahamCampbell/Result-Type.git", + "reference": "7e279d2cd5d7fbb156ce46daada972355cea27bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/7e279d2cd5d7fbb156ce46daada972355cea27bb", + "reference": "7e279d2cd5d7fbb156ce46daada972355cea27bb", + "shasum": "" + }, + "require": { + "php": "^7.0|^8.0", + "phpoption/phpoption": "^1.7.3" + }, + "require-dev": { + "phpunit/phpunit": "^6.5|^7.5|^8.5|^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "GrahamCampbell\\ResultType\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "graham@alt-three.com" + } + ], + "description": "An Implementation Of The Result Type", + "keywords": [ + "Graham Campbell", + "GrahamCampbell", + "Result Type", + "Result-Type", + "result" + ], + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", + "type": "tidelift" + } + ], + "time": "2020-04-13T13:17:36+00:00" + }, { "name": "gregwar/captcha", "version": "v1.1.8", @@ -1541,6 +1597,729 @@ ], "time": "2020-09-30T07:37:11+00:00" }, + { + "name": "hoa/compiler", + "version": "3.17.08.08", + "source": { + "type": "git", + "url": "https://github.com/hoaproject/Compiler.git", + "reference": "aa09caf0bf28adae6654ca6ee415ee2f522672de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hoaproject/Compiler/zipball/aa09caf0bf28adae6654ca6ee415ee2f522672de", + "reference": "aa09caf0bf28adae6654ca6ee415ee2f522672de", + "shasum": "" + }, + "require": { + "hoa/consistency": "~1.0", + "hoa/exception": "~1.0", + "hoa/file": "~1.0", + "hoa/iterator": "~2.0", + "hoa/math": "~1.0", + "hoa/protocol": "~1.0", + "hoa/regex": "~1.0", + "hoa/visitor": "~2.0" + }, + "require-dev": { + "hoa/json": "~2.0", + "hoa/test": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Hoa\\Compiler\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Ivan Enderlin", + "email": "ivan.enderlin@hoa-project.net" + }, + { + "name": "Hoa community", + "homepage": "https://hoa-project.net/" + } + ], + "description": "The Hoa\\Compiler library.", + "homepage": "https://hoa-project.net/", + "keywords": [ + "algebraic", + "ast", + "compiler", + "context-free", + "coverage", + "exhaustive", + "grammar", + "isotropic", + "language", + "lexer", + "library", + "ll1", + "llk", + "parser", + "pp", + "random", + "regular", + "rule", + "sampler", + "syntax", + "token", + "trace", + "uniform" + ], + "time": "2017-08-08T07:44:07+00:00" + }, + { + "name": "hoa/consistency", + "version": "1.17.05.02", + "source": { + "type": "git", + "url": "https://github.com/hoaproject/Consistency.git", + "reference": "fd7d0adc82410507f332516faf655b6ed22e4c2f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hoaproject/Consistency/zipball/fd7d0adc82410507f332516faf655b6ed22e4c2f", + "reference": "fd7d0adc82410507f332516faf655b6ed22e4c2f", + "shasum": "" + }, + "require": { + "hoa/exception": "~1.0", + "php": ">=5.5.0" + }, + "require-dev": { + "hoa/stream": "~1.0", + "hoa/test": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Hoa\\Consistency\\": "." + }, + "files": [ + "Prelude.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Ivan Enderlin", + "email": "ivan.enderlin@hoa-project.net" + }, + { + "name": "Hoa community", + "homepage": "https://hoa-project.net/" + } + ], + "description": "The Hoa\\Consistency library.", + "homepage": "https://hoa-project.net/", + "keywords": [ + "autoloader", + "callable", + "consistency", + "entity", + "flex", + "keyword", + "library" + ], + "time": "2017-05-02T12:18:12+00:00" + }, + { + "name": "hoa/event", + "version": "1.17.01.13", + "source": { + "type": "git", + "url": "https://github.com/hoaproject/Event.git", + "reference": "6c0060dced212ffa3af0e34bb46624f990b29c54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hoaproject/Event/zipball/6c0060dced212ffa3af0e34bb46624f990b29c54", + "reference": "6c0060dced212ffa3af0e34bb46624f990b29c54", + "shasum": "" + }, + "require": { + "hoa/consistency": "~1.0", + "hoa/exception": "~1.0" + }, + "require-dev": { + "hoa/test": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Hoa\\Event\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Ivan Enderlin", + "email": "ivan.enderlin@hoa-project.net" + }, + { + "name": "Hoa community", + "homepage": "https://hoa-project.net/" + } + ], + "description": "The Hoa\\Event library.", + "homepage": "https://hoa-project.net/", + "keywords": [ + "event", + "library", + "listener", + "observer" + ], + "time": "2017-01-13T15:30:50+00:00" + }, + { + "name": "hoa/exception", + "version": "1.17.01.16", + "source": { + "type": "git", + "url": "https://github.com/hoaproject/Exception.git", + "reference": "091727d46420a3d7468ef0595651488bfc3a458f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hoaproject/Exception/zipball/091727d46420a3d7468ef0595651488bfc3a458f", + "reference": "091727d46420a3d7468ef0595651488bfc3a458f", + "shasum": "" + }, + "require": { + "hoa/consistency": "~1.0", + "hoa/event": "~1.0" + }, + "require-dev": { + "hoa/test": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Hoa\\Exception\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Ivan Enderlin", + "email": "ivan.enderlin@hoa-project.net" + }, + { + "name": "Hoa community", + "homepage": "https://hoa-project.net/" + } + ], + "description": "The Hoa\\Exception library.", + "homepage": "https://hoa-project.net/", + "keywords": [ + "exception", + "library" + ], + "time": "2017-01-16T07:53:27+00:00" + }, + { + "name": "hoa/file", + "version": "1.17.07.11", + "source": { + "type": "git", + "url": "https://github.com/hoaproject/File.git", + "reference": "35cb979b779bc54918d2f9a4e02ed6c7a1fa67ca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hoaproject/File/zipball/35cb979b779bc54918d2f9a4e02ed6c7a1fa67ca", + "reference": "35cb979b779bc54918d2f9a4e02ed6c7a1fa67ca", + "shasum": "" + }, + "require": { + "hoa/consistency": "~1.0", + "hoa/event": "~1.0", + "hoa/exception": "~1.0", + "hoa/iterator": "~2.0", + "hoa/stream": "~1.0" + }, + "require-dev": { + "hoa/test": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Hoa\\File\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Ivan Enderlin", + "email": "ivan.enderlin@hoa-project.net" + }, + { + "name": "Hoa community", + "homepage": "https://hoa-project.net/" + } + ], + "description": "The Hoa\\File library.", + "homepage": "https://hoa-project.net/", + "keywords": [ + "Socket", + "directory", + "file", + "finder", + "library", + "link", + "temporary" + ], + "time": "2017-07-11T07:42:15+00:00" + }, + { + "name": "hoa/iterator", + "version": "2.17.01.10", + "source": { + "type": "git", + "url": "https://github.com/hoaproject/Iterator.git", + "reference": "d1120ba09cb4ccd049c86d10058ab94af245f0cc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hoaproject/Iterator/zipball/d1120ba09cb4ccd049c86d10058ab94af245f0cc", + "reference": "d1120ba09cb4ccd049c86d10058ab94af245f0cc", + "shasum": "" + }, + "require": { + "hoa/consistency": "~1.0", + "hoa/exception": "~1.0" + }, + "require-dev": { + "hoa/test": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Hoa\\Iterator\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Ivan Enderlin", + "email": "ivan.enderlin@hoa-project.net" + }, + { + "name": "Hoa community", + "homepage": "https://hoa-project.net/" + } + ], + "description": "The Hoa\\Iterator library.", + "homepage": "https://hoa-project.net/", + "keywords": [ + "iterator", + "library" + ], + "time": "2017-01-10T10:34:47+00:00" + }, + { + "name": "hoa/math", + "version": "1.17.05.16", + "source": { + "type": "git", + "url": "https://github.com/hoaproject/Math.git", + "reference": "7150785d30f5d565704912116a462e9f5bc83a0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hoaproject/Math/zipball/7150785d30f5d565704912116a462e9f5bc83a0c", + "reference": "7150785d30f5d565704912116a462e9f5bc83a0c", + "shasum": "" + }, + "require": { + "hoa/compiler": "~3.0", + "hoa/consistency": "~1.0", + "hoa/exception": "~1.0", + "hoa/iterator": "~2.0", + "hoa/protocol": "~1.0", + "hoa/zformat": "~1.0" + }, + "require-dev": { + "hoa/test": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Hoa\\Math\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Ivan Enderlin", + "email": "ivan.enderlin@hoa-project.net" + }, + { + "name": "Hoa community", + "homepage": "https://hoa-project.net/" + } + ], + "description": "The Hoa\\Math library.", + "homepage": "https://hoa-project.net/", + "keywords": [ + "arrangement", + "combination", + "combinatorics", + "counting", + "library", + "math", + "permutation", + "sampler", + "set" + ], + "time": "2017-05-16T08:02:17+00:00" + }, + { + "name": "hoa/regex", + "version": "1.17.01.13", + "source": { + "type": "git", + "url": "https://github.com/hoaproject/Regex.git", + "reference": "7e263a61b6fb45c1d03d8e5ef77668518abd5bec" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hoaproject/Regex/zipball/7e263a61b6fb45c1d03d8e5ef77668518abd5bec", + "reference": "7e263a61b6fb45c1d03d8e5ef77668518abd5bec", + "shasum": "" + }, + "require": { + "hoa/consistency": "~1.0", + "hoa/exception": "~1.0", + "hoa/math": "~1.0", + "hoa/protocol": "~1.0", + "hoa/ustring": "~4.0", + "hoa/visitor": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Hoa\\Regex\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Ivan Enderlin", + "email": "ivan.enderlin@hoa-project.net" + }, + { + "name": "Hoa community", + "homepage": "https://hoa-project.net/" + } + ], + "description": "The Hoa\\Regex library.", + "homepage": "https://hoa-project.net/", + "keywords": [ + "compiler", + "library", + "regex" + ], + "time": "2017-01-13T16:10:24+00:00" + }, + { + "name": "hoa/stream", + "version": "1.17.02.21", + "source": { + "type": "git", + "url": "https://github.com/hoaproject/Stream.git", + "reference": "3293cfffca2de10525df51436adf88a559151d82" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hoaproject/Stream/zipball/3293cfffca2de10525df51436adf88a559151d82", + "reference": "3293cfffca2de10525df51436adf88a559151d82", + "shasum": "" + }, + "require": { + "hoa/consistency": "~1.0", + "hoa/event": "~1.0", + "hoa/exception": "~1.0", + "hoa/protocol": "~1.0" + }, + "require-dev": { + "hoa/test": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Hoa\\Stream\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Ivan Enderlin", + "email": "ivan.enderlin@hoa-project.net" + }, + { + "name": "Hoa community", + "homepage": "https://hoa-project.net/" + } + ], + "description": "The Hoa\\Stream library.", + "homepage": "https://hoa-project.net/", + "keywords": [ + "Context", + "bucket", + "composite", + "filter", + "in", + "library", + "out", + "protocol", + "stream", + "wrapper" + ], + "time": "2017-02-21T16:01:06+00:00" + }, + { + "name": "hoa/ustring", + "version": "4.17.01.16", + "source": { + "type": "git", + "url": "https://github.com/hoaproject/Ustring.git", + "reference": "e6326e2739178799b1fe3fdd92029f9517fa17a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hoaproject/Ustring/zipball/e6326e2739178799b1fe3fdd92029f9517fa17a0", + "reference": "e6326e2739178799b1fe3fdd92029f9517fa17a0", + "shasum": "" + }, + "require": { + "hoa/consistency": "~1.0", + "hoa/exception": "~1.0" + }, + "require-dev": { + "hoa/test": "~2.0" + }, + "suggest": { + "ext-iconv": "ext/iconv must be present (or a third implementation) to use Hoa\\Ustring::transcode().", + "ext-intl": "To get a better Hoa\\Ustring::toAscii() and Hoa\\Ustring::compareTo()." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Hoa\\Ustring\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Ivan Enderlin", + "email": "ivan.enderlin@hoa-project.net" + }, + { + "name": "Hoa community", + "homepage": "https://hoa-project.net/" + } + ], + "description": "The Hoa\\Ustring library.", + "homepage": "https://hoa-project.net/", + "keywords": [ + "library", + "search", + "string", + "unicode" + ], + "time": "2017-01-16T07:08:25+00:00" + }, + { + "name": "hoa/visitor", + "version": "2.17.01.16", + "source": { + "type": "git", + "url": "https://github.com/hoaproject/Visitor.git", + "reference": "c18fe1cbac98ae449e0d56e87469103ba08f224a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hoaproject/Visitor/zipball/c18fe1cbac98ae449e0d56e87469103ba08f224a", + "reference": "c18fe1cbac98ae449e0d56e87469103ba08f224a", + "shasum": "" + }, + "require": { + "hoa/consistency": "~1.0" + }, + "require-dev": { + "hoa/test": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Hoa\\Visitor\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Ivan Enderlin", + "email": "ivan.enderlin@hoa-project.net" + }, + { + "name": "Hoa community", + "homepage": "https://hoa-project.net/" + } + ], + "description": "The Hoa\\Visitor library.", + "homepage": "https://hoa-project.net/", + "keywords": [ + "library", + "structure", + "visit", + "visitor" + ], + "time": "2017-01-16T07:02:03+00:00" + }, + { + "name": "hoa/zformat", + "version": "1.17.01.10", + "source": { + "type": "git", + "url": "https://github.com/hoaproject/Zformat.git", + "reference": "522c381a2a075d4b9dbb42eb4592dd09520e4ac2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hoaproject/Zformat/zipball/522c381a2a075d4b9dbb42eb4592dd09520e4ac2", + "reference": "522c381a2a075d4b9dbb42eb4592dd09520e4ac2", + "shasum": "" + }, + "require": { + "hoa/consistency": "~1.0", + "hoa/exception": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Hoa\\Zformat\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Ivan Enderlin", + "email": "ivan.enderlin@hoa-project.net" + }, + { + "name": "Hoa community", + "homepage": "https://hoa-project.net/" + } + ], + "description": "The Hoa\\Zformat library.", + "homepage": "https://hoa-project.net/", + "keywords": [ + "library", + "parameter", + "zformat" + ], + "time": "2017-01-10T10:39:54+00:00" + }, { "name": "intervention/image", "version": "2.5.1", @@ -1611,168 +2390,23 @@ ], "time": "2019-11-02T09:15:47+00:00" }, - { - "name": "laminas/laminas-diactoros", - "version": "2.4.1", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-diactoros.git", - "reference": "36ef09b73e884135d2059cc498c938e90821bb57" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/36ef09b73e884135d2059cc498c938e90821bb57", - "reference": "36ef09b73e884135d2059cc498c938e90821bb57", - "shasum": "" - }, - "require": { - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^7.1", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" - }, - "conflict": { - "phpspec/prophecy": "<1.9.0" - }, - "provide": { - "psr/http-factory-implementation": "1.0", - "psr/http-message-implementation": "1.0" - }, - "replace": { - "zendframework/zend-diactoros": "^2.2.1" - }, - "require-dev": { - "ext-curl": "*", - "ext-dom": "*", - "ext-gd": "*", - "ext-libxml": "*", - "http-interop/http-factory-tests": "^0.5.0", - "laminas/laminas-coding-standard": "~1.0.0", - "php-http/psr7-integration-tests": "^1.0", - "phpunit/phpunit": "^7.5.18" - }, - "type": "library", - "extra": { - "laminas": { - "config-provider": "Laminas\\Diactoros\\ConfigProvider", - "module": "Laminas\\Diactoros" - } - }, - "autoload": { - "files": [ - "src/functions/create_uploaded_file.php", - "src/functions/marshal_headers_from_sapi.php", - "src/functions/marshal_method_from_sapi.php", - "src/functions/marshal_protocol_version_from_sapi.php", - "src/functions/marshal_uri_from_sapi.php", - "src/functions/normalize_server.php", - "src/functions/normalize_uploaded_files.php", - "src/functions/parse_cookie_header.php", - "src/functions/create_uploaded_file.legacy.php", - "src/functions/marshal_headers_from_sapi.legacy.php", - "src/functions/marshal_method_from_sapi.legacy.php", - "src/functions/marshal_protocol_version_from_sapi.legacy.php", - "src/functions/marshal_uri_from_sapi.legacy.php", - "src/functions/normalize_server.legacy.php", - "src/functions/normalize_uploaded_files.legacy.php", - "src/functions/parse_cookie_header.legacy.php" - ], - "psr-4": { - "Laminas\\Diactoros\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "PSR HTTP Message implementations", - "homepage": "https://laminas.dev", - "keywords": [ - "http", - "laminas", - "psr", - "psr-17", - "psr-7" - ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2020-09-03T14:29:41+00:00" - }, - { - "name": "laminas/laminas-zendframework-bridge", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-zendframework-bridge.git", - "reference": "6ede70583e101030bcace4dcddd648f760ddf642" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/6ede70583e101030bcace4dcddd648f760ddf642", - "reference": "6ede70583e101030bcace4dcddd648f760ddf642", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.1 || ^9.3", - "squizlabs/php_codesniffer": "^3.5" - }, - "type": "library", - "extra": { - "laminas": { - "module": "Laminas\\ZendFrameworkBridge" - } - }, - "autoload": { - "files": [ - "src/autoload.php" - ], - "psr-4": { - "Laminas\\ZendFrameworkBridge\\": "src//" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Alias legacy ZF class names to Laminas Project equivalents.", - "keywords": [ - "ZendFramework", - "autoloading", - "laminas", - "zf" - ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2020-09-14T14:23:00+00:00" - }, { "name": "laravel/framework", - "version": "v7.28.4", + "version": "v8.10.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "de187e9200948bab6975167e480950abcd5efdac" + "reference": "0c80950806cd1bc6d9a7068585a12c2bfa23bdf3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/de187e9200948bab6975167e480950abcd5efdac", - "reference": "de187e9200948bab6975167e480950abcd5efdac", + "url": "https://api.github.com/repos/laravel/framework/zipball/0c80950806cd1bc6d9a7068585a12c2bfa23bdf3", + "reference": "0c80950806cd1bc6d9a7068585a12c2bfa23bdf3", "shasum": "" }, "require": { "doctrine/inflector": "^1.4|^2.0", - "dragonmantank/cron-expression": "^2.0", + "dragonmantank/cron-expression": "^3.0", "egulias/email-validator": "^2.1.10", "ext-json": "*", "ext-mbstring": "*", @@ -1781,24 +2415,23 @@ "league/flysystem": "^1.0.34", "monolog/monolog": "^2.0", "nesbot/carbon": "^2.17", - "opis/closure": "^3.1", - "php": "^7.2.5", + "opis/closure": "^3.5.3", + "php": "^7.3", "psr/container": "^1.0", "psr/simple-cache": "^1.0", - "ramsey/uuid": "^3.7|^4.0", + "ramsey/uuid": "^4.0", "swiftmailer/swiftmailer": "^6.0", - "symfony/console": "^5.0", - "symfony/error-handler": "^5.0", - "symfony/finder": "^5.0", - "symfony/http-foundation": "^5.0", - "symfony/http-kernel": "^5.0", - "symfony/mime": "^5.0", - "symfony/polyfill-php73": "^1.17", - "symfony/process": "^5.0", - "symfony/routing": "^5.0", - "symfony/var-dumper": "^5.0", + "symfony/console": "^5.1", + "symfony/error-handler": "^5.1", + "symfony/finder": "^5.1", + "symfony/http-foundation": "^5.1", + "symfony/http-kernel": "^5.1", + "symfony/mime": "^5.1", + "symfony/process": "^5.1", + "symfony/routing": "^5.1", + "symfony/var-dumper": "^5.1", "tijsverkoyen/css-to-inline-styles": "^2.2.2", - "vlucas/phpdotenv": "^4.0", + "vlucas/phpdotenv": "^5.2", "voku/portable-ascii": "^1.4.8" }, "conflict": { @@ -1812,6 +2445,7 @@ "illuminate/broadcasting": "self.version", "illuminate/bus": "self.version", "illuminate/cache": "self.version", + "illuminate/collections": "self.version", "illuminate/config": "self.version", "illuminate/console": "self.version", "illuminate/container": "self.version", @@ -1824,6 +2458,7 @@ "illuminate/hashing": "self.version", "illuminate/http": "self.version", "illuminate/log": "self.version", + "illuminate/macroable": "self.version", "illuminate/mail": "self.version", "illuminate/notifications": "self.version", "illuminate/pagination": "self.version", @@ -1842,15 +2477,14 @@ "aws/aws-sdk-php": "^3.0", "doctrine/dbal": "^2.6", "filp/whoops": "^2.4", - "guzzlehttp/guzzle": "^6.3.1|^7.0", + "guzzlehttp/guzzle": "^6.5.5|^7.0.1", "league/flysystem-cached-adapter": "^1.0", "mockery/mockery": "^1.3.1", - "moontoast/math": "^1.1", - "orchestra/testbench-core": "^5.0", + "orchestra/testbench-core": "^6.0", "pda/pheanstalk": "^4.0", "phpunit/phpunit": "^8.4|^9.0", "predis/predis": "^1.1.1", - "symfony/cache": "^5.0" + "symfony/cache": "^5.1" }, "suggest": { "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.0).", @@ -1863,37 +2497,42 @@ "ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0).", "filp/whoops": "Required for friendly error pages in development (^2.4).", "fzaninotto/faker": "Required to use the eloquent factory builder (^1.9.1).", - "guzzlehttp/guzzle": "Required to use the HTTP Client, Mailgun mail driver and the ping methods on schedules (^6.3.1|^7.0).", + "guzzlehttp/guzzle": "Required to use the HTTP Client, Mailgun mail driver and the ping methods on schedules (^6.5.5|^7.0.1).", "laravel/tinker": "Required to use the tinker console command (^2.0).", "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).", "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).", "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).", "mockery/mockery": "Required to use mocking (^1.3.1).", - "moontoast/math": "Required to use ordered UUIDs (^1.1).", "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).", "pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).", "phpunit/phpunit": "Required to use assertions and run tests (^8.4|^9.0).", "predis/predis": "Required to use the predis connector (^1.1.2).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0).", - "symfony/cache": "Required to PSR-6 cache bridge (^5.0).", - "symfony/filesystem": "Required to create relative storage directory symbolic links (^5.0).", + "symfony/cache": "Required to PSR-6 cache bridge (^5.1).", + "symfony/filesystem": "Required to enable support for relative symbolic links (^5.1).", "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0).", "wildbit/swiftmailer-postmark": "Required to use Postmark mail driver (^3.0)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "7.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { "files": [ + "src/Illuminate/Collections/helpers.php", + "src/Illuminate/Events/functions.php", "src/Illuminate/Foundation/helpers.php", "src/Illuminate/Support/helpers.php" ], "psr-4": { - "Illuminate\\": "src/Illuminate/" + "Illuminate\\": "src/Illuminate/", + "Illuminate\\Support\\": [ + "src/Illuminate/Macroable/", + "src/Illuminate/Collections/" + ] } }, "notification-url": "https://packagist.org/downloads/", @@ -1912,51 +2551,49 @@ "framework", "laravel" ], - "time": "2020-10-06T14:22:09+00:00" + "time": "2020-10-13T14:20:53+00:00" }, { "name": "laravel/passport", - "version": "v9.3.2", + "version": "v10.0.1", "source": { "type": "git", "url": "https://github.com/laravel/passport.git", - "reference": "192fe387c1c173c12f82784e2a1b51be8bd1bf45" + "reference": "4e53f1b237a9e51ac10f0b30c6ebedd68f6848ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/passport/zipball/192fe387c1c173c12f82784e2a1b51be8bd1bf45", - "reference": "192fe387c1c173c12f82784e2a1b51be8bd1bf45", + "url": "https://api.github.com/repos/laravel/passport/zipball/4e53f1b237a9e51ac10f0b30c6ebedd68f6848ab", + "reference": "4e53f1b237a9e51ac10f0b30c6ebedd68f6848ab", "shasum": "" }, "require": { "ext-json": "*", "firebase/php-jwt": "^5.0", - "guzzlehttp/guzzle": "^6.0|^7.0", - "illuminate/auth": "^6.18.31|^7.22.4", - "illuminate/console": "^6.18.31|^7.22.4", - "illuminate/container": "^6.18.31|^7.22.4", - "illuminate/contracts": "^6.18.31|^7.22.4", - "illuminate/cookie": "^6.18.31|^7.22.4", - "illuminate/database": "^6.18.31|^7.22.4", - "illuminate/encryption": "^6.18.31|^7.22.4", - "illuminate/http": "^6.18.31|^7.22.4", - "illuminate/support": "^6.18.31|^7.22.4", - "laminas/laminas-diactoros": "^2.2", + "illuminate/auth": "^8.2", + "illuminate/console": "^8.2", + "illuminate/container": "^8.2", + "illuminate/contracts": "^8.2", + "illuminate/cookie": "^8.2", + "illuminate/database": "^8.2", + "illuminate/encryption": "^8.2", + "illuminate/http": "^8.2", + "illuminate/support": "^8.2", "league/oauth2-server": "^8.1", - "nyholm/psr7": "^1.0", - "php": "^7.2", + "nyholm/psr7": "^1.3", + "php": "^7.3", "phpseclib/phpseclib": "^2.0", "symfony/psr-http-message-bridge": "^2.0" }, "require-dev": { "mockery/mockery": "^1.0", - "orchestra/testbench": "^4.4|^5.0", - "phpunit/phpunit": "^8.0" + "orchestra/testbench": "^6.0", + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "10.x-dev" }, "laravel": { "providers": [ @@ -1966,7 +2603,8 @@ }, "autoload": { "psr-4": { - "Laravel\\Passport\\": "src/" + "Laravel\\Passport\\": "src/", + "Laravel\\Passport\\Database\\Factories\\": "database/factories/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1985,7 +2623,7 @@ "oauth", "passport" ], - "time": "2020-07-27T18:34:39+00:00" + "time": "2020-09-15T16:41:42+00:00" }, { "name": "lcobucci/jwt", @@ -2424,23 +3062,25 @@ }, { "name": "lorisleiva/laravel-search-string", - "version": "v0.1.6", + "version": "v1.0.4", "source": { "type": "git", "url": "https://github.com/lorisleiva/laravel-search-string.git", - "reference": "68189cad7614d0c9cb09a83315e1ccfe49e7f0c1" + "reference": "f1b1a8cfe95617b1a9b02016fcc05eaaab8886fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lorisleiva/laravel-search-string/zipball/68189cad7614d0c9cb09a83315e1ccfe49e7f0c1", - "reference": "68189cad7614d0c9cb09a83315e1ccfe49e7f0c1", + "url": "https://api.github.com/repos/lorisleiva/laravel-search-string/zipball/f1b1a8cfe95617b1a9b02016fcc05eaaab8886fb", + "reference": "f1b1a8cfe95617b1a9b02016fcc05eaaab8886fb", "shasum": "" }, "require": { - "illuminate/support": "^5.5|^6.0|^7.0" + "hoa/compiler": "^3.17", + "illuminate/support": "^5.5|^6.0|^7.0|^8.0", + "sanmai/hoa-protocol": "^1.17" }, "require-dev": { - "orchestra/testbench": "^5.0" + "orchestra/testbench": "^4.0|^5.0|^6.0" }, "type": "library", "extra": { @@ -2466,7 +3106,7 @@ } ], "description": "Generates database queries based on one unique string using a simple and customizable syntax.", - "time": "2020-04-05T15:40:30+00:00" + "time": "2020-09-17T15:21:35+00:00" }, { "name": "monolog/monolog", @@ -2713,35 +3353,35 @@ }, { "name": "nunomaduro/collision", - "version": "v4.2.0", + "version": "v5.0.2", "source": { "type": "git", "url": "https://github.com/nunomaduro/collision.git", - "reference": "d50490417eded97be300a92cd7df7badc37a9018" + "reference": "4a343299054e9368d0db4a982a780cc4ffa12707" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/collision/zipball/d50490417eded97be300a92cd7df7badc37a9018", - "reference": "d50490417eded97be300a92cd7df7badc37a9018", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/4a343299054e9368d0db4a982a780cc4ffa12707", + "reference": "4a343299054e9368d0db4a982a780cc4ffa12707", "shasum": "" }, "require": { "facade/ignition-contracts": "^1.0", - "filp/whoops": "^2.4", - "php": "^7.2.5", + "filp/whoops": "^2.7.2", + "php": "^7.3", "symfony/console": "^5.0" }, "require-dev": { - "facade/ignition": "^2.0", - "fideloper/proxy": "^4.2", - "friendsofphp/php-cs-fixer": "^2.16", - "fruitcake/laravel-cors": "^1.0", - "laravel/framework": "^7.0", - "laravel/tinker": "^2.0", - "nunomaduro/larastan": "^0.5", - "orchestra/testbench": "^5.0", - "phpstan/phpstan": "^0.12.3", - "phpunit/phpunit": "^8.5.1 || ^9.0" + "fideloper/proxy": "^4.4.0", + "friendsofphp/php-cs-fixer": "^2.16.4", + "fruitcake/laravel-cors": "^2.0.1", + "laravel/framework": "^8.0", + "laravel/tinker": "^2.4.1", + "nunomaduro/larastan": "^0.6.2", + "nunomaduro/mock-final-classes": "^1.0", + "orchestra/testbench": "^6.0", + "phpstan/phpstan": "^0.12.36", + "phpunit/phpunit": "^9.3.3" }, "type": "library", "extra": { @@ -2779,7 +3419,21 @@ "php", "symfony" ], - "time": "2020-04-04T19:56:08+00:00" + "funding": [ + { + "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2020-08-27T18:58:22+00:00" }, { "name": "nyholm/psr7", @@ -3719,25 +4373,26 @@ }, { "name": "rcrowe/twigbridge", - "version": "v0.11.3", + "version": "v0.12.2", "source": { "type": "git", "url": "https://github.com/rcrowe/TwigBridge.git", - "reference": "b50247faf2f570eb2b2d0d3c98b4461f1ef60b2d" + "reference": "a4faebbb0c18cf775fda4247c926faa6319ee611" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rcrowe/TwigBridge/zipball/b50247faf2f570eb2b2d0d3c98b4461f1ef60b2d", - "reference": "b50247faf2f570eb2b2d0d3c98b4461f1ef60b2d", + "url": "https://api.github.com/repos/rcrowe/TwigBridge/zipball/a4faebbb0c18cf775fda4247c926faa6319ee611", + "reference": "a4faebbb0c18cf775fda4247c926faa6319ee611", "shasum": "" }, "require": { - "illuminate/support": "^5.5|^6|^7", - "illuminate/view": "^5.5|^6|^7", + "illuminate/support": "^5.5|^6|^7|^8", + "illuminate/view": "^5.5|^6|^7|^8", "php": ">=7.1", - "twig/twig": "~2.0" + "twig/twig": "^2.11" }, "require-dev": { + "ext-json": "*", "laravel/framework": "5.5.*", "mockery/mockery": "0.9.*", "phpunit/phpunit": "~6.0", @@ -3751,7 +4406,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "0.11-dev" + "dev-master": "0.12-dev" }, "laravel": { "providers": [ @@ -3787,7 +4442,71 @@ "laravel", "twig" ], - "time": "2020-02-27T13:59:54+00:00" + "time": "2020-09-07T12:36:34+00:00" + }, + { + "name": "sanmai/hoa-protocol", + "version": "1.17.01.14", + "source": { + "type": "git", + "url": "https://github.com/sanmai/Protocol.git", + "reference": "c8d9ac20711f92abba774af33eef1a87ab44bf0e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sanmai/Protocol/zipball/c8d9ac20711f92abba774af33eef1a87ab44bf0e", + "reference": "c8d9ac20711f92abba774af33eef1a87ab44bf0e", + "shasum": "" + }, + "require": { + "hoa/consistency": "*", + "hoa/exception": "*", + "php": "^7.0" + }, + "replace": { + "hoa/protocol": "*" + }, + "require-dev": { + "atoum/atoum": "^3", + "atoum/stubs": "*", + "hoa/test": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Hoa\\Protocol\\": "Source", + "Hoa\\Protocol\\Bin\\": "Bin" + }, + "files": [ + "Source/Wrapper.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Ivan Enderlin" + }, + { + "name": "Hoa community" + } + ], + "description": "The Hoa\\Protocol library.", + "keywords": [ + "library", + "protocol", + "resource", + "stream", + "wrapper" + ], + "time": "2019-09-15T07:01:41+00:00" }, { "name": "scrivo/highlight.php", @@ -6634,7 +7353,7 @@ }, { "name": "tymon/jwt-auth", - "version": "dev-develop", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/tymondesigns/jwt-auth.git", @@ -6770,37 +7489,39 @@ }, { "name": "vlucas/phpdotenv", - "version": "v4.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "572af79d913627a9d70374d27a6f5d689a35de32" + "reference": "fba64139db67123c7a57072e5f8d3db10d160b66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/572af79d913627a9d70374d27a6f5d689a35de32", - "reference": "572af79d913627a9d70374d27a6f5d689a35de32", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/fba64139db67123c7a57072e5f8d3db10d160b66", + "reference": "fba64139db67123c7a57072e5f8d3db10d160b66", "shasum": "" }, "require": { - "php": "^5.5.9 || ^7.0 || ^8.0", - "phpoption/phpoption": "^1.7.3", - "symfony/polyfill-ctype": "^1.17" + "ext-pcre": "*", + "graham-campbell/result-type": "^1.0.1", + "php": "^7.1.3 || ^8.0", + "phpoption/phpoption": "^1.7.4", + "symfony/polyfill-ctype": "^1.17", + "symfony/polyfill-mbstring": "^1.17", + "symfony/polyfill-php80": "^1.17" }, "require-dev": { "bamarni/composer-bin-plugin": "^1.4.1", "ext-filter": "*", - "ext-pcre": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7.27 || ^6.5.6 || ^7.0" + "phpunit/phpunit": "^7.5.20 || ^8.5.2 || ^9.0" }, "suggest": { - "ext-filter": "Required to use the boolean validator.", - "ext-pcre": "Required to use most of the library." + "ext-filter": "Required to use the boolean validator." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "5.2-dev" } }, "autoload": { @@ -6840,7 +7561,7 @@ "type": "tidelift" } ], - "time": "2020-07-14T19:22:52+00:00" + "time": "2020-09-14T15:57:31+00:00" }, { "name": "voku/portable-ascii", @@ -7379,30 +8100,33 @@ }, { "name": "mockery/mockery", - "version": "1.3.3", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "60fa2f67f6e4d3634bb4a45ff3171fa52215800d" + "reference": "20cab678faed06fac225193be281ea0fddb43b93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/60fa2f67f6e4d3634bb4a45ff3171fa52215800d", - "reference": "60fa2f67f6e4d3634bb4a45ff3171fa52215800d", + "url": "https://api.github.com/repos/mockery/mockery/zipball/20cab678faed06fac225193be281ea0fddb43b93", + "reference": "20cab678faed06fac225193be281ea0fddb43b93", "shasum": "" }, "require": { "hamcrest/hamcrest-php": "^2.0.1", "lib-pcre": ">=7.0", - "php": ">=5.6.0" + "php": "^7.3 || ^8.0" + }, + "conflict": { + "phpunit/phpunit": "<8.0" }, "require-dev": { - "phpunit/phpunit": "^5.7.10|^6.5|^7.5|^8.5|^9.3" + "phpunit/phpunit": "^8.5 || ^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "1.4.x-dev" } }, "autoload": { @@ -7440,7 +8164,7 @@ "test double", "testing" ], - "time": "2020-08-11T18:10:21+00:00" + "time": "2020-08-11T18:10:13+00:00" }, { "name": "myclabs/deep-copy", @@ -9474,9 +10198,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "tymon/jwt-auth": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/database/factories/PlayerFactory.php b/database/factories/PlayerFactory.php new file mode 100644 index 00000000..23b65876 --- /dev/null +++ b/database/factories/PlayerFactory.php @@ -0,0 +1,21 @@ + User::factory(), + 'name' => $this->faker->firstName, + 'tid_skin' => 0, + ]; + } +} diff --git a/database/factories/PlayerModelFactory.php b/database/factories/PlayerModelFactory.php deleted file mode 100644 index 6722c1c2..00000000 --- a/database/factories/PlayerModelFactory.php +++ /dev/null @@ -1,12 +0,0 @@ -define(Player::class, function (Faker\Generator $faker) { - return [ - 'uid' => factory(App\Models\User::class)->create()->uid, - 'name' => $faker->firstName, - 'tid_skin' => 0, - ]; -}); diff --git a/database/factories/TextureFactory.php b/database/factories/TextureFactory.php new file mode 100644 index 00000000..ceb90adf --- /dev/null +++ b/database/factories/TextureFactory.php @@ -0,0 +1,41 @@ + $this->faker->firstName, + 'type' => 'steve', + 'hash' => $this->faker->sha256, + 'size' => rand(1, 2048), + 'likes' => rand(1, 10), + 'uploader' => User::factory(), + 'public' => true, + 'upload_at' => $this->faker->dateTime, + ]; + } + + public function alex() + { + return $this->state(['type' => 'alex']); + } + + public function cape() + { + return $this->state(['type' => 'cape']); + } + + public function private() + { + return $this->state(['public' => false]); + } +} diff --git a/database/factories/TextureModelFactory.php b/database/factories/TextureModelFactory.php deleted file mode 100644 index 038f886e..00000000 --- a/database/factories/TextureModelFactory.php +++ /dev/null @@ -1,23 +0,0 @@ -define(Texture::class, function (Faker\Generator $faker) { - return [ - 'name' => $faker->firstName, - 'type' => 'steve', - 'hash' => $faker->sha256, - 'size' => rand(1, 2048), - 'likes' => rand(1, 10), - 'uploader' => factory(App\Models\User::class)->create()->uid, - 'public' => true, - 'upload_at' => $faker->dateTime, - ]; -}); - -$factory->state(Texture::class, 'alex', ['type' => 'alex']); - -$factory->state(Texture::class, 'cape', ['type' => 'cape']); - -$factory->state(Texture::class, 'private', ['public' => false]); diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php new file mode 100644 index 00000000..6ecea602 --- /dev/null +++ b/database/factories/UserFactory.php @@ -0,0 +1,44 @@ + $this->faker->email, + 'nickname' => $this->faker->name, + 'locale' => null, + 'score' => 1000, + 'avatar' => 0, + 'password' => app('cipher')->hash(Str::random(10), config('secure.salt')), + 'ip' => $this->faker->ipv4, + 'permission' => 0, + 'verified' => true, + 'last_sign_at' => $this->faker->dateTime->format('d-M-Y H:i:s'), + 'register_at' => $this->faker->dateTime->format('d-M-Y H:i:s'), + ]; + } + + public function admin() + { + return $this->state(['permission' => 1]); + } + + public function superAdmin() + { + return $this->state(['permission' => 2]); + } + + public function banned() + { + return $this->state(['permission' => -1]); + } +} diff --git a/database/factories/UserModelFactory.php b/database/factories/UserModelFactory.php deleted file mode 100644 index ef9fad36..00000000 --- a/database/factories/UserModelFactory.php +++ /dev/null @@ -1,27 +0,0 @@ -define(User::class, function (Faker\Generator $faker) { - return [ - 'email' => $faker->email, - 'nickname' => $faker->name, - 'locale' => null, - 'score' => 1000, - 'avatar' => 0, - 'password' => app('cipher')->hash(Str::random(10), config('secure.salt')), - 'ip' => '127.0.0.1', - 'permission' => 0, - 'verified' => true, - 'last_sign_at' => $faker->dateTime->format('d-M-Y H:i:s'), - 'register_at' => $faker->dateTime->format('d-M-Y H:i:s'), - ]; -}); - -$factory->state(User::class, 'admin', ['permission' => 1]); - -$factory->state(User::class, 'superAdmin', ['permission' => 2]); - -$factory->state(User::class, 'banned', ['permission' => -1]); diff --git a/public/index.php b/public/index.php index b7be5f35..54f3663f 100755 --- a/public/index.php +++ b/public/index.php @@ -2,6 +2,10 @@ define('LARAVEL_START', microtime(true)); +if (file_exists(__DIR__.'/../storage/framework/maintenance.php')) { + require __DIR__.'/../storage/framework/maintenance.php'; +} + /* |-------------------------------------------------------------------------- | Register The Auto Loader diff --git a/tests/ExceptionsTests/HandlerTest.php b/tests/ExceptionsTests/HandlerTest.php index df7b3d7d..e0c79942 100644 --- a/tests/ExceptionsTests/HandlerTest.php +++ b/tests/ExceptionsTests/HandlerTest.php @@ -8,7 +8,7 @@ class HandlerTest extends TestCase { public function testRenderAjaxException() { - $json = $this->get('/abc', ['Accept' => 'application/json'])->decodeResponseJson(); + $json = $this->get('/abc', ['Accept' => 'application/json'])->json(); $this->assertIsString($json['message']); $this->assertTrue($json['exception']); $this->assertTrue(collect($json['trace'])->every( diff --git a/tests/HttpTest/ControllersTest/AdminControllerTest.php b/tests/HttpTest/ControllersTest/AdminControllerTest.php index 38d6fcdc..192de91b 100644 --- a/tests/HttpTest/ControllersTest/AdminControllerTest.php +++ b/tests/HttpTest/ControllersTest/AdminControllerTest.php @@ -15,7 +15,7 @@ class AdminControllerTest extends TestCase { // Do not use `WithoutMiddleware` trait parent::setUp(); - $this->actingAs(factory(\App\Models\User::class)->states('admin')->create()); + $this->actingAs(User::factory()->admin()->create()); } public function testIndex() @@ -28,9 +28,9 @@ class AdminControllerTest extends TestCase public function testChartData() { - factory(User::class)->create(); - factory(User::class)->create(['register_at' => '2019-01-01 00:00:00']); - factory(Texture::class)->create(); + User::factory()->create(); + User::factory()->create(['register_at' => '2019-01-01 00:00:00']); + Texture::factory()->create(); $this->getJson('/admin/chart') ->assertJson(['labels' => [ trans('admin.index.user-registration'), diff --git a/tests/HttpTest/ControllersTest/AuthControllerTest.php b/tests/HttpTest/ControllersTest/AuthControllerTest.php index d6b18a86..4c55518d 100644 --- a/tests/HttpTest/ControllersTest/AuthControllerTest.php +++ b/tests/HttpTest/ControllersTest/AuthControllerTest.php @@ -45,9 +45,9 @@ class AuthControllerTest extends TestCase { Event::fake(); - $user = factory(User::class)->create(); + $user = User::factory()->create(); $user->changePassword('12345678'); - $player = factory(Player::class)->create(['uid' => $user->uid]); + $player = Player::factory()->create(['uid' => $user->uid]); // Should return a warning if `identification` is empty $this->postJson('/auth/login')->assertJsonValidationErrors('identification'); @@ -218,7 +218,7 @@ class AuthControllerTest extends TestCase { Event::fake(); - $user = factory(User::class)->create(); + $user = User::factory()->create(); $this->actingAs($user)->postJson('/auth/logout')->assertJson( [ 'code' => 0, @@ -263,7 +263,7 @@ class AuthControllerTest extends TestCase )->assertJsonValidationErrors('email'); // An existed user - $existedUser = factory(User::class)->create(); + $existedUser = User::factory()->create(); $this->postJson( '/auth/register', ['email' => $existedUser->email] @@ -328,7 +328,7 @@ class AuthControllerTest extends TestCase )->assertJsonValidationErrors('player_name'); // Existed player - $player = factory(Player::class)->create(); + $player = Player::factory()->create(); $this->postJson( '/auth/register', [ @@ -559,7 +559,7 @@ class AuthControllerTest extends TestCase $this->flushSession(); // Should return a warning if user is not existed - $user = factory(User::class)->create(); + $user = User::factory()->create(); $this->withSession(['phrase' => 'a'])->postJson('/auth/forgot', [ 'email' => 'nope@nope.net', 'captcha' => 'a', @@ -630,7 +630,7 @@ class AuthControllerTest extends TestCase public function testReset() { - $user = factory(User::class)->create(); + $user = User::factory()->create(); $url = URL::temporarySignedRoute( 'auth.reset', Carbon::now()->addHour(), @@ -651,7 +651,7 @@ class AuthControllerTest extends TestCase { Event::fake(); - $user = factory(User::class)->create(); + $user = User::factory()->create(); $url = URL::temporarySignedRoute( 'auth.reset', Carbon::now()->addHour(), @@ -711,8 +711,8 @@ class AuthControllerTest extends TestCase public function testFillEmail() { - $user = factory(User::class)->create(['email' => '']); - $other = factory(User::class)->create(); + $user = User::factory()->create(['email' => '']); + $other = User::factory()->create(); $this->actingAs($user)->post('/auth/bind')->assertRedirect('/'); $this->actingAs($user)->post('/auth/bind', ['email' => 'a'])->assertRedirect('/'); $this->actingAs($user)->post('/auth/bind', ['email' => $other->email])->assertRedirect('/'); @@ -734,14 +734,14 @@ class AuthControllerTest extends TestCase // invalid link $this->get(route('auth.verify', ['user' => 1]))->assertForbidden(); - $user = factory(User::class)->create(['verified' => false]); + $user = User::factory()->create(['verified' => false]); $url = URL::signedRoute('auth.verify', ['user' => $user], null, false); $this->get($url)->assertViewIs('auth.verify'); } public function testHandleVerify() { - $user = factory(User::class)->create(['verified' => false]); + $user = User::factory()->create(['verified' => false]); $url = URL::signedRoute('auth.verify', ['user' => $user], null, false); // empty email @@ -761,14 +761,14 @@ class AuthControllerTest extends TestCase public function testApiLogin() { - $user = factory(User::class)->create(); + $user = User::factory()->create(); $user->changePassword('12345678'); $this->postJson('/api/auth/login')->assertJson(['token' => false]); $token = $this->postJson('/api/auth/login', [ 'email' => $user->email, 'password' => '12345678', - ])->decodeResponseJson('token'); + ])->json('token'); $this->assertTrue(is_string($token)); $this->postJson('/api/auth/login', [ @@ -779,12 +779,12 @@ class AuthControllerTest extends TestCase public function testApiLogout() { - $user = factory(User::class)->create(); + $user = User::factory()->create(); $user->changePassword('12345678'); $token = $this->postJson('/api/auth/login', [ 'email' => $user->email, 'password' => '12345678', - ])->decodeResponseJson('token'); + ])->json('token'); $this->post('/api/auth/logout', [], [ 'Authorization' => "Bearer $token", @@ -793,16 +793,16 @@ class AuthControllerTest extends TestCase public function testApiRefresh() { - $user = factory(User::class)->create(); + $user = User::factory()->create(); $user->changePassword('12345678'); $token = $this->postJson('/api/auth/login', [ 'email' => $user->email, 'password' => '12345678', - ])->decodeResponseJson('token'); + ])->json('token'); $token = $this->postJson('/api/auth/refresh', [], [ 'Authorization' => "Bearer $token", - ])->decodeResponseJson('token'); + ])->json('token'); $this->assertTrue(is_string($token)); } } diff --git a/tests/HttpTest/ControllersTest/ClosetControllerTest.php b/tests/HttpTest/ControllersTest/ClosetControllerTest.php index 188cf907..a4a50f76 100644 --- a/tests/HttpTest/ControllersTest/ClosetControllerTest.php +++ b/tests/HttpTest/ControllersTest/ClosetControllerTest.php @@ -15,7 +15,7 @@ class ClosetControllerTest extends TestCase public function testIndex() { $filter = Fakes\Filter::fake(); - $user = factory(User::class)->create(); + $user = User::factory()->create(); $this->actingAs($user)->get('/user/closet')->assertViewIs('user.closet'); $filter->assertApplied('grid:user.closet'); @@ -23,8 +23,8 @@ class ClosetControllerTest extends TestCase public function testGetClosetData() { - $user = factory(User::class)->create(); - $textures = factory(Texture::class, 10)->create(); + $user = User::factory()->create(); + $textures = Texture::factory()->count(10)->create(); $textures->each(function ($t) use ($user) { $user->closet()->attach($t->tid, ['item_name' => $t->name]); }); @@ -37,7 +37,7 @@ class ClosetControllerTest extends TestCase ]); // Get capes - $cape = factory(Texture::class)->states('cape')->create(); + $cape = Texture::factory()->cape()->create(); $user->closet()->attach($cape->tid, ['item_name' => 'custom_name']); $this->getJson('/user/closet/list?category=cape') ->assertJson(['data' => [[ @@ -60,8 +60,8 @@ class ClosetControllerTest extends TestCase public function testAllIds() { - $texture = factory(Texture::class)->create(); - $user = factory(User::class)->create(); + $texture = Texture::factory()->create(); + $user = User::factory()->create(); $user->closet()->attach($texture->tid, ['item_name' => '']); $this->actingAs($user) @@ -72,9 +72,9 @@ class ClosetControllerTest extends TestCase public function testAdd() { Event::fake(); - $user = factory(User::class)->create(); - $uploader = factory(User::class)->create(['score' => 0]); - $texture = factory(Texture::class)->create(['uploader' => $uploader->uid]); + $user = User::factory()->create(); + $uploader = User::factory()->create(['score' => 0]); + $texture = Texture::factory()->create(['uploader' => $uploader->uid]); $likes = $texture->likes; $name = 'my'; option(['score_per_closet_item' => 10]); @@ -157,7 +157,7 @@ class ClosetControllerTest extends TestCase // texture is private option(['score_award_per_like' => 5]); - $privateTexture = factory(Texture::class)->create([ + $privateTexture = Texture::factory()->create([ 'public' => false, 'uploader' => $uploader->uid + 1, ]); @@ -170,10 +170,10 @@ class ClosetControllerTest extends TestCase ]); // administrator can add it. - $privateTexture = factory(Texture::class)->state('private')->create([ + $privateTexture = Texture::factory()->private()->create([ 'uploader' => 0, ]); - $this->actingAs(factory(User::class)->state('admin')->create()) + $this->actingAs(User::factory()->admin()->create()) ->postJson( route('user.closet.add'), ['tid' => $privateTexture->tid, 'name' => $name] @@ -232,8 +232,8 @@ class ClosetControllerTest extends TestCase public function testRename() { Event::fake(); - $user = factory(User::class)->create(); - $texture = factory(Texture::class)->create(); + $user = User::factory()->create(); + $texture = Texture::factory()->create(); $name = 'new'; // missing `name` field @@ -325,9 +325,9 @@ class ClosetControllerTest extends TestCase public function testRemove() { Event::fake(); - $user = factory(User::class)->create(); - $uploader = factory(User::class)->create(['score' => 5]); - $texture = factory(Texture::class)->create(['uploader' => $uploader->uid]); + $user = User::factory()->create(); + $uploader = User::factory()->create(['score' => 5]); + $texture = Texture::factory()->create(['uploader' => $uploader->uid]); $likes = $texture->likes; // rename a not-existed texture diff --git a/tests/HttpTest/ControllersTest/ClosetManagementControllerTest.php b/tests/HttpTest/ControllersTest/ClosetManagementControllerTest.php index 7c2a1ddd..b440a125 100644 --- a/tests/HttpTest/ControllersTest/ClosetManagementControllerTest.php +++ b/tests/HttpTest/ControllersTest/ClosetManagementControllerTest.php @@ -14,13 +14,13 @@ class ClosetManagementControllerTest extends TestCase protected function setUp(): void { parent::setUp(); - $this->actingAs(factory(User::class)->states('admin')->create()); + $this->actingAs(User::factory()->admin()->create()); } public function testList() { - $texture = factory(Texture::class)->create(); - $admin = factory(User::class)->states('admin')->create(); + $texture = Texture::factory()->create(); + $admin = User::factory()->admin()->create(); $admin->closet()->attach($texture->tid); $this->actingAs($admin, 'oauth') @@ -31,8 +31,8 @@ class ClosetManagementControllerTest extends TestCase public function testAdd() { Event::fake(); - $user = factory(User::class)->create(); - $texture = factory(Texture::class)->create(); + $user = User::factory()->create(); + $texture = Texture::factory()->create(); $this->postJson('/admin/closet/'.$user->uid, ['tid' => $texture->tid]) ->assertJson([ @@ -70,8 +70,8 @@ class ClosetManagementControllerTest extends TestCase public function testRemove() { Event::fake(); - $user = factory(User::class)->create(); - $texture = factory(Texture::class)->create(); + $user = User::factory()->create(); + $texture = Texture::factory()->create(); $user->closet()->attach($texture->tid, ['item_name' => '']); $this->deleteJson('/admin/closet/'.$user->uid, ['tid' => $texture->tid]) diff --git a/tests/HttpTest/ControllersTest/MarketControllerTest.php b/tests/HttpTest/ControllersTest/MarketControllerTest.php index 01366826..b65e5e41 100644 --- a/tests/HttpTest/ControllersTest/MarketControllerTest.php +++ b/tests/HttpTest/ControllersTest/MarketControllerTest.php @@ -2,6 +2,7 @@ namespace Tests; +use App\Models\User; use App\Services\Plugin; use App\Services\PluginManager; use App\Services\Unzip; @@ -12,7 +13,7 @@ class MarketControllerTest extends TestCase protected function setUp(): void { parent::setUp(); - $this->actingAs(factory(\App\Models\User::class)->states('superAdmin')->create()); + $this->actingAs(User::factory()->superAdmin()->create()); } public function testDownload() diff --git a/tests/HttpTest/ControllersTest/NotificationsControllerTest.php b/tests/HttpTest/ControllersTest/NotificationsControllerTest.php index 3653f446..61359552 100644 --- a/tests/HttpTest/ControllersTest/NotificationsControllerTest.php +++ b/tests/HttpTest/ControllersTest/NotificationsControllerTest.php @@ -11,8 +11,8 @@ class NotificationsControllerTest extends TestCase { public function testSend() { - $admin = factory(User::class)->states('admin')->create(); - $normal = factory(User::class)->create(); + $admin = User::factory()->admin()->create(); + $normal = User::factory()->create(); Notification::fake(); $this->actingAs($admin) @@ -93,7 +93,7 @@ class NotificationsControllerTest extends TestCase public function testAll() { - $user = factory(User::class)->create(); + $user = User::factory()->create(); $notification = new Notifications\SiteMessage('title', 'content'); Notification::send([$user], $notification); @@ -107,7 +107,7 @@ class NotificationsControllerTest extends TestCase public function testRead() { - $user = factory(User::class)->create(); + $user = User::factory()->create(); $user->notify(new Notifications\SiteMessage('Hyouka', 'Kotenbu?')); $user->refresh(); $notification = $user->unreadNotifications->first(); diff --git a/tests/HttpTest/ControllersTest/OptionsControllerTest.php b/tests/HttpTest/ControllersTest/OptionsControllerTest.php index edca9ee7..5eb8d6b4 100644 --- a/tests/HttpTest/ControllersTest/OptionsControllerTest.php +++ b/tests/HttpTest/ControllersTest/OptionsControllerTest.php @@ -2,6 +2,7 @@ namespace Tests; +use App\Models\User; use Cache; use Illuminate\Foundation\Testing\DatabaseTransactions; use Mockery; @@ -18,7 +19,7 @@ class OptionsControllerTest extends BrowserKitTestCase \App\Services\Translations\JavaScript::class, Mockery::spy(\App\Services\Translations\JavaScript::class) ); - $this->actingAs(factory(\App\Models\User::class)->states('admin')->create()); + $this->actingAs(User::factory()->admin()->create()); } public function testCustomize() diff --git a/tests/HttpTest/ControllersTest/PlayerControllerTest.php b/tests/HttpTest/ControllersTest/PlayerControllerTest.php index dec16127..e617da2f 100644 --- a/tests/HttpTest/ControllersTest/PlayerControllerTest.php +++ b/tests/HttpTest/ControllersTest/PlayerControllerTest.php @@ -17,7 +17,7 @@ class PlayerControllerTest extends TestCase protected function setUp(): void { parent::setUp(); - $this->actingAs(factory(User::class)->create()); + $this->actingAs(User::factory()->create()); } public function testIndex() @@ -30,8 +30,8 @@ class PlayerControllerTest extends TestCase public function testList() { - $user = factory(User::class)->create(); - $player = factory(Player::class)->create(['uid' => $user->uid]); + $user = User::factory()->create(); + $player = Player::factory()->create(['uid' => $user->uid]); $this->actingAs($user) ->get('/user/player/list') ->assertJson([$player->toArray()]); @@ -39,8 +39,8 @@ class PlayerControllerTest extends TestCase public function testAccessControl() { - $user = factory(User::class)->make(); - $player = factory(Player::class)->create(); + $user = User::factory()->make(); + $player = Player::factory()->create(); $this->actingAs($user) ->deleteJson(route('user.player.delete', ['player' => $player])) @@ -76,12 +76,12 @@ class PlayerControllerTest extends TestCase // with an existed player name option(['player_name_rule' => 'official']); - $existed = factory(Player::class)->create(); + $existed = Player::factory()->create(); $this->postJson(route('user.player.add'), ['name' => $existed->name]) ->assertJsonValidationErrors('name'); // Lack of score - $user = factory(User::class)->create(['score' => 0]); + $user = User::factory()->create(['score' => 0]); $this->actingAs($user)->postJson( route('user.player.add'), ['name' => 'no_score'] @@ -122,7 +122,7 @@ class PlayerControllerTest extends TestCase // Allowed to use CJK characters Event::fake(); option(['player_name_rule' => 'cjk']); - $user = factory(User::class)->create(); + $user = User::factory()->create(); $score = $user->score; $this->actingAs($user)->postJson(route('user.player.add'), [ 'name' => '角色名', @@ -165,8 +165,8 @@ class PlayerControllerTest extends TestCase Event::fake(); $filter = Fakes\Filter::fake(); - $user = factory(User::class)->create(); - $player = factory(Player::class)->create(['uid' => $user->uid]); + $user = User::factory()->create(); + $player = Player::factory()->create(['uid' => $user->uid]); $score = $user->score; // rejected @@ -214,7 +214,7 @@ class PlayerControllerTest extends TestCase // No returning score option(['return_score' => false]); - $player = factory(Player::class)->create(); + $player = Player::factory()->create(); $user = $player->user; $this->actingAs($user) ->deleteJson(route('user.player.delete', ['player' => $player])) @@ -231,7 +231,7 @@ class PlayerControllerTest extends TestCase public function testRename() { Event::fake(); - $player = factory(Player::class)->create(); + $player = Player::factory()->create(); $user = $player->user; // Without new player name @@ -254,7 +254,7 @@ class PlayerControllerTest extends TestCase )->assertJsonValidationErrors('name'); // with an existed player name - $existed = factory(Player::class)->create(); + $existed = Player::factory()->create(); $this->putJson( route('user.player.rename', ['player' => $player]), ['name' => $existed->name] @@ -268,7 +268,7 @@ class PlayerControllerTest extends TestCase return new Rejection('rejected'); }); - factory(Player::class)->create()->name; + Player::factory()->create()->name; $this->putJson( route('user.player.rename', ['player' => $player]), ['name' => 'new'] @@ -314,10 +314,10 @@ class PlayerControllerTest extends TestCase public function testSetTexture() { - $player = factory(Player::class)->create(); + $player = Player::factory()->create(); $user = $player->user; - $skin = factory(Texture::class)->create(); - $cape = factory(Texture::class)->state('cape')->create(); + $skin = Texture::factory()->create(); + $cape = Texture::factory()->cape()->create(); // rejected $filter = Fakes\Filter::fake(); @@ -341,7 +341,7 @@ class PlayerControllerTest extends TestCase ]); // set a private texture - $private = factory(Texture::class)->state('private')->create(); + $private = Texture::factory()->private()->create(); $this->putJson( route('user.player.set', ['player' => $player]), ['skin' => $private->tid] @@ -397,7 +397,7 @@ class PlayerControllerTest extends TestCase public function testClearTexture() { Event::fake(); - $player = factory(Player::class)->create(); + $player = Player::factory()->create(); $user = $player->user; $player->tid_skin = 1; diff --git a/tests/HttpTest/ControllersTest/PlayersManagementControllerTest.php b/tests/HttpTest/ControllersTest/PlayersManagementControllerTest.php index ec4b3d4e..eb54c752 100644 --- a/tests/HttpTest/ControllersTest/PlayersManagementControllerTest.php +++ b/tests/HttpTest/ControllersTest/PlayersManagementControllerTest.php @@ -15,12 +15,12 @@ class PlayersManagementControllerTest extends TestCase protected function setUp(): void { parent::setUp(); - $this->actingAs(factory(User::class)->states('admin')->create()); + $this->actingAs(User::factory()->admin()->create()); } public function testList() { - $player = factory(Player::class)->create(); + $player = Player::factory()->create(); $this->getJson(route('admin.players.list')) ->assertJson(['data' => [$player->toArray()]]); @@ -29,9 +29,9 @@ class PlayersManagementControllerTest extends TestCase public function testAccessControl() { // an admin can't operate another admin's player - $admin = factory(User::class)->states('admin')->create(); + $admin = User::factory()->admin()->create(); /** @var Player */ - $player = factory(Player::class)->create(['uid' => $admin->uid]); + $player = Player::factory()->create(['uid' => $admin->uid]); $this->putJson( route('admin.players.name', ['player' => $player->pid]), ['player_name' => 'abcd'] @@ -48,9 +48,9 @@ class PlayersManagementControllerTest extends TestCase )->assertJson(['code' => 0]); // super admin - $superAdmin = factory(User::class)->states('superAdmin')->create(); + $superAdmin = User::factory()->superAdmin()->create(); /** @var Player */ - $player = factory(Player::class)->create(['uid' => $superAdmin->uid]); + $player = Player::factory()->create(['uid' => $superAdmin->uid]); $this->putJson( route('admin.players.name', ['player' => $player->pid]), ['player_name' => 'abcd'] @@ -63,7 +63,7 @@ class PlayersManagementControllerTest extends TestCase public function testName() { /** @var Player */ - $player = factory(Player::class)->create(); + $player = Player::factory()->create(); // missing `player_name` field $this->putJson( @@ -113,7 +113,7 @@ class PlayersManagementControllerTest extends TestCase Event::fake(); /** @var Player */ - $player = factory(Player::class)->create(); + $player = Player::factory()->create(); // missing `uid` field $this->putJson(route('admin.players.owner', ['player' => $player->pid])) @@ -147,7 +147,7 @@ class PlayersManagementControllerTest extends TestCase // change owner successfully Event::fake(); /** @var User */ - $user = factory(User::class)->create(); + $user = User::factory()->create(); $this->putJson( route('admin.players.owner', ['player' => $player->pid]), ['uid' => $user->uid] @@ -183,7 +183,7 @@ class PlayersManagementControllerTest extends TestCase Event::fake(); /** @var Player */ - $player = factory(Player::class)->create(); + $player = Player::factory()->create(); // missing `tid` field $this->putJson( @@ -229,9 +229,9 @@ class PlayersManagementControllerTest extends TestCase Event::assertNotDispatched('player.texture.updated'); /** @var Texture */ - $skin = factory(Texture::class)->create(); + $skin = Texture::factory()->create(); /** @var Texture */ - $cape = factory(Texture::class)->states('cape')->create(); + $cape = Texture::factory()->cape()->create(); // skin Event::fake(); @@ -349,7 +349,7 @@ class PlayersManagementControllerTest extends TestCase Event::fake(); /** @var Player */ - $player = factory(Player::class)->create(); + $player = Player::factory()->create(); $this->deleteJson(route('admin.players.delete', ['player' => $player->pid])) ->assertJson([ diff --git a/tests/HttpTest/ControllersTest/PluginControllerTest.php b/tests/HttpTest/ControllersTest/PluginControllerTest.php index 7eb9afef..7c7c4f1b 100644 --- a/tests/HttpTest/ControllersTest/PluginControllerTest.php +++ b/tests/HttpTest/ControllersTest/PluginControllerTest.php @@ -2,6 +2,7 @@ namespace Tests; +use App\Models\User; use App\Services\Plugin; use App\Services\PluginManager; use App\Services\Unzip; @@ -17,7 +18,7 @@ class PluginControllerTest extends TestCase protected function setUp(): void { parent::setUp(); - $this->actingAs(factory(\App\Models\User::class)->states('superAdmin')->create()); + $this->actingAs(User::factory()->superAdmin()->create()); } public function testShowManage() diff --git a/tests/HttpTest/ControllersTest/ReportControllerTest.php b/tests/HttpTest/ControllersTest/ReportControllerTest.php index d2c9ae57..f079e8a0 100644 --- a/tests/HttpTest/ControllersTest/ReportControllerTest.php +++ b/tests/HttpTest/ControllersTest/ReportControllerTest.php @@ -20,8 +20,8 @@ class ReportControllerTest extends TestCase Event::fake(); $filter = resolve(Filter::class); - $user = factory(User::class)->create(); - $texture = factory(Texture::class)->create(); + $user = User::factory()->create(); + $texture = Texture::factory()->create(); // without `tid` field $this->actingAs($user) @@ -104,7 +104,7 @@ class ReportControllerTest extends TestCase public function testTrack() { - $user = factory(User::class)->create(); + $user = User::factory()->create(); $report = new Report(); $report->tid = 1; $report->uploader = 0; @@ -121,9 +121,9 @@ class ReportControllerTest extends TestCase public function testManage() { - $uploader = factory(User::class)->create(); - $reporter = factory(User::class)->states('admin')->create(); - $texture = factory(Texture::class)->create(['uploader' => $uploader->uid]); + $uploader = User::factory()->create(); + $reporter = User::factory()->admin()->create(); + $texture = Texture::factory()->create(['uploader' => $uploader->uid]); $report = new Report(); $report->tid = $texture->tid; @@ -142,8 +142,8 @@ class ReportControllerTest extends TestCase { Event::fake(); - $admin = factory(User::class)->states('admin')->create(); - $texture = factory(Texture::class)->create(['uploader' => $admin->uid]); + $admin = User::factory()->admin()->create(); + $texture = Texture::factory()->create(['uploader' => $admin->uid]); $report = new Report(); $report->tid = $texture->tid; @@ -180,10 +180,10 @@ class ReportControllerTest extends TestCase { Event::fake(); - $uploader = factory(User::class)->create(); - $reporter = factory(User::class)->create(); - $admin = factory(User::class)->states('admin')->create(); - $texture = factory(Texture::class)->create(['uploader' => $uploader->uid]); + $uploader = User::factory()->create(); + $reporter = User::factory()->create(); + $admin = User::factory()->admin()->create(); + $texture = Texture::factory()->create(['uploader' => $uploader->uid]); $report = new Report(); $report->tid = $texture->tid; @@ -238,10 +238,10 @@ class ReportControllerTest extends TestCase Event::fake(); $disk = Storage::fake('textures'); - $uploader = factory(User::class)->create(); - $reporter = factory(User::class)->create(); - $admin = factory(User::class)->states('admin')->create(); - $texture = factory(Texture::class)->create(['uploader' => $uploader->uid]); + $uploader = User::factory()->create(); + $reporter = User::factory()->create(); + $admin = User::factory()->admin()->create(); + $texture = Texture::factory()->create(['uploader' => $uploader->uid]); $disk->put($texture->hash, ''); $report = new Report(); @@ -306,10 +306,10 @@ class ReportControllerTest extends TestCase { Event::fake(); - $uploader = factory(User::class)->create(); - $reporter = factory(User::class)->create(); - $admin = factory(User::class)->states('admin')->create(); - $texture = factory(Texture::class)->create(['uploader' => $uploader->uid]); + $uploader = User::factory()->create(); + $reporter = User::factory()->create(); + $admin = User::factory()->admin()->create(); + $texture = Texture::factory()->create(['uploader' => $uploader->uid]); $report = new Report(); $report->tid = $texture->tid; @@ -351,10 +351,10 @@ class ReportControllerTest extends TestCase { Event::fake(); - $uploader = factory(User::class)->create(); - $reporter = factory(User::class)->create(); - $admin = factory(User::class)->states('admin')->create(); - $texture = factory(Texture::class)->create(['uploader' => $uploader->uid]); + $uploader = User::factory()->create(); + $reporter = User::factory()->create(); + $admin = User::factory()->admin()->create(); + $texture = Texture::factory()->create(['uploader' => $uploader->uid]); $report = new Report(); $report->tid = $texture->tid; diff --git a/tests/HttpTest/ControllersTest/SkinlibControllerTest.php b/tests/HttpTest/ControllersTest/SkinlibControllerTest.php index 5e5af665..d1db219b 100644 --- a/tests/HttpTest/ControllersTest/SkinlibControllerTest.php +++ b/tests/HttpTest/ControllersTest/SkinlibControllerTest.php @@ -20,8 +20,8 @@ class SkinlibControllerTest extends TestCase { Storage::fake('textures'); - $other = factory(User::class)->create(); - $texture = factory(Texture::class)->create(); + $other = User::factory()->create(); + $texture = Texture::factory()->create(); // other user should not be able to delete $this->actingAs($other) @@ -30,24 +30,24 @@ class SkinlibControllerTest extends TestCase ->assertForbidden(); // administrators can delete it - $this->actingAs(factory(User::class)->states('admin')->create()) + $this->actingAs(User::factory()->admin()->create()) ->deleteJson(route('texture.delete', ['texture' => $texture])) ->assertJson(['code' => 0]); } public function testLibrary() { - $steve = factory(Texture::class)->create([ + $steve = Texture::factory()->create([ 'name' => 'ab', 'upload_at' => Carbon::now()->subDays(2), 'likes' => 80, ]); - $alex = factory(Texture::class)->states('alex')->create([ + $alex = Texture::factory()->alex()->create([ 'name' => 'cd', 'upload_at' => Carbon::now()->subDays(1), 'likes' => 60, ]); - $private = factory(Texture::class)->states('private')->create([ + $private = Texture::factory()->private()->create([ 'upload_at' => Carbon::now(), ]); @@ -75,10 +75,10 @@ class SkinlibControllerTest extends TestCase ['tid' => $steve->tid, 'nickname' => $steve->owner->nickname], ], ]); - $user = factory(User::class)->create(); + $user = User::factory()->create(); $list = $this->actingAs($user) ->getJson('/skinlib/list?keyword=a') - ->decodeResponseJson('data'); + ->json('data'); $this->assertCount(1, $list); // with uploader @@ -99,7 +99,7 @@ class SkinlibControllerTest extends TestCase ]); // private textures are not available for other user - $this->actingAs(factory(User::class)->create()) + $this->actingAs(User::factory()->create()) ->getJson('/skinlib/list') ->assertJson([ 'data' => [ @@ -120,7 +120,7 @@ class SkinlibControllerTest extends TestCase ]); // private textures are available for administrators - $this->actingAs(factory(User::class)->states('admin')->create()) + $this->actingAs(User::factory()->admin()->create()) ->getJson('/skinlib/list') ->assertJson([ 'data' => [ @@ -138,7 +138,7 @@ class SkinlibControllerTest extends TestCase // Invalid texture option(['auto_del_invalid_texture' => false]); - $texture = factory(Texture::class)->create(); + $texture = Texture::factory()->create(); $this->get('/skinlib/show/'.$texture->tid) ->assertSee(trans('skinlib.show.deleted')); $this->assertNotNull(Texture::find($texture->tid)); @@ -149,14 +149,14 @@ class SkinlibControllerTest extends TestCase $this->assertNull(Texture::find($texture->tid)); // Show a texture - $texture = factory(Texture::class)->create(); + $texture = Texture::factory()->create(); Storage::disk('textures')->put($texture->hash, ''); $this->get('/skinlib/show/'.$texture->tid)->assertViewHas('texture'); $filter->assertApplied('grid:skinlib.show'); // Guest should not see private texture - $uploader = factory(User::class)->create(); - $texture = factory(Texture::class)->create([ + $uploader = User::factory()->create(); + $texture = Texture::factory()->create([ 'uploader' => $uploader->uid, 'public' => false, ]); @@ -172,12 +172,12 @@ class SkinlibControllerTest extends TestCase option(['status_code_for_private' => 403]); // Other user should not see private texture - $this->actingAs(factory(User::class)->create()) + $this->actingAs(User::factory()->create()) ->get('/skinlib/show/'.$texture->tid) ->assertSee(trans('skinlib.show.private')); // Administrators should be able to see private textures - $this->actingAs(factory(User::class)->states('admin')->create()) + $this->actingAs(User::factory()->admin()->create()) ->get('/skinlib/show/'.$texture->tid) ->assertViewHas('texture'); @@ -210,7 +210,7 @@ class SkinlibControllerTest extends TestCase ->assertNotFound() ->assertSee(trans('skinlib.non-existent')); - $texture = factory(Texture::class)->create(); + $texture = Texture::factory()->create(); $this->get(route('texture.info', ['texture' => $texture])) ->assertJson($texture->toArray()); } @@ -219,7 +219,7 @@ class SkinlibControllerTest extends TestCase { $filter = Fakes\Filter::fake(); - $this->actingAs(factory(User::class)->create())->get('/skinlib/upload'); + $this->actingAs(User::factory()->create())->get('/skinlib/upload'); $filter->assertApplied('grid:skinlib.upload'); option(['texture_name_regexp' => 'abc']); @@ -232,7 +232,7 @@ class SkinlibControllerTest extends TestCase /** @var FilesystemAdapter */ $disk = Storage::fake('textures'); $filter = Fakes\Filter::fake(); - $user = factory(User::class)->create(); + $user = User::factory()->create(); // without file $this->actingAs($user) @@ -347,7 +347,7 @@ class SkinlibControllerTest extends TestCase $upload = UploadedFile::fake()->image('texture.png', 64, 32); // score is not enough - $user = factory(User::class)->create(['score' => 0]); + $user = User::factory()->create(['score' => 0]); $this->actingAs($user) ->postJson(route('texture.upload'), [ 'name' => 'texture', @@ -360,7 +360,7 @@ class SkinlibControllerTest extends TestCase 'message' => trans('skinlib.upload.lack-score'), ]); - $user = factory(User::class)->create([ + $user = User::factory()->create([ 'score' => (int) option('score_per_closet_item') + (int) option('score_per_storage'), ]); $this->actingAs($user)->postJson( @@ -437,7 +437,7 @@ class SkinlibControllerTest extends TestCase ); // upload a duplicated texture - $user = factory(User::class)->create(); + $user = User::factory()->create(); $this->actingAs($user) ->postJson(route('texture.upload'), [ 'name' => 'texture', @@ -487,10 +487,10 @@ class SkinlibControllerTest extends TestCase /** @var FilesystemAdapter */ $disk = Storage::fake('textures'); - $uploader = factory(User::class)->create(); - $texture = factory(Texture::class)->create(['uploader' => $uploader->uid]); + $uploader = User::factory()->create(); + $texture = Texture::factory()->create(['uploader' => $uploader->uid]); - $duplicate = factory(Texture::class)->create([ + $duplicate = Texture::factory()->create([ 'hash' => $texture->hash, 'uploader' => $uploader->uid, ]); @@ -545,12 +545,12 @@ class SkinlibControllerTest extends TestCase public function testPrivacy() { Event::fake(); - $uploader = factory(User::class)->create(); - $other = factory(User::class)->create(); - $texture = factory(Texture::class)->create(['uploader' => $uploader->uid]); + $uploader = User::factory()->create(); + $other = User::factory()->create(); + $texture = Texture::factory()->create(['uploader' => $uploader->uid]); // setting a texture to be private needs more scores - $texture = factory(Texture::class)->create(['uploader' => $uploader->uid]); + $texture = Texture::factory()->create(['uploader' => $uploader->uid]); $uploader->score = 0; $uploader->save(); $this->actingAs($uploader) @@ -626,7 +626,7 @@ class SkinlibControllerTest extends TestCase // When setting a texture to be private, // other players should not be able to use it. - $texture = factory(Texture::class)->create(['uploader' => $uploader->uid]); + $texture = Texture::factory()->create(['uploader' => $uploader->uid]); $uploader->score += $texture->size * option('private_score_per_storage'); $uploader->save(); $this->putJson(route('texture.privacy', ['texture' => $texture])) @@ -637,7 +637,7 @@ class SkinlibControllerTest extends TestCase // take back the score option(['score_award_per_texture' => 5]); - $texture = factory(Texture::class)->create(['uploader' => $uploader->uid]); + $texture = Texture::factory()->create(['uploader' => $uploader->uid]); $uploader->score = $texture->size * ( option('private_score_per_storage') - option('score_per_storage') ); @@ -651,8 +651,8 @@ class SkinlibControllerTest extends TestCase option(['return_score' => false, 'private_score_per_storage' => 0]); $uploader->score += 1000; $uploader->save(); - $texture = factory(Texture::class)->create(['public' => 'false', 'uploader' => $uploader->uid]); - $other = factory(User::class)->create(); + $texture = Texture::factory()->private()->create(['uploader' => $uploader->uid]); + $other = User::factory()->create(); $other->closet()->attach($texture->tid, ['item_name' => 'a']); $this->putJson(route('texture.privacy', ['texture' => $texture])) ->assertJson(['code' => 0]); @@ -662,8 +662,8 @@ class SkinlibControllerTest extends TestCase public function testRename() { Event::fake(); - $uploader = factory(User::class)->create(); - $texture = factory(Texture::class)->create(['uploader' => $uploader->uid]); + $uploader = User::factory()->create(); + $texture = Texture::factory()->create(['uploader' => $uploader->uid]); // without `name` field $this->actingAs($uploader) @@ -723,10 +723,10 @@ class SkinlibControllerTest extends TestCase public function testType() { Event::fake(); - $uploader = factory(User::class)->create(); - $other = factory(User::class)->create(); - $texture = factory(Texture::class) - ->states('alex') + $uploader = User::factory()->create(); + $other = User::factory()->create(); + $texture = Texture::factory() + ->alex() ->create(['uploader' => $uploader->uid]); // missing `type` field @@ -768,7 +768,7 @@ class SkinlibControllerTest extends TestCase } ); - $duplicate = factory(Texture::class)->states('alex')->create([ + $duplicate = Texture::factory()->alex()->create([ 'uploader' => $other->uid, 'hash' => $texture->hash, ]); diff --git a/tests/HttpTest/ControllersTest/TextureControllerTest.php b/tests/HttpTest/ControllersTest/TextureControllerTest.php index c664050a..10ded3fd 100644 --- a/tests/HttpTest/ControllersTest/TextureControllerTest.php +++ b/tests/HttpTest/ControllersTest/TextureControllerTest.php @@ -17,13 +17,13 @@ class TextureControllerTest extends TestCase public function testJson() { - $steve = factory(Texture::class)->create(); + $steve = Texture::factory()->create(); // Player is not existed $this->get('/nope.json')->assertStatus(404); // Player is banned - $player = factory(Player::class)->create(['tid_skin' => $steve->tid]); + $player = Player::factory()->create(['tid_skin' => $steve->tid]); $player->user->permission = User::BANNED; $player->user->save(); $this->get("/{$player->name}.json") @@ -50,7 +50,7 @@ class TextureControllerTest extends TestCase $mock->shouldReceive('renderCape')->andReturn(Image::canvas(1, 1)); }); - $skin = factory(Texture::class)->create(); + $skin = Texture::factory()->create(); $disk->put($skin->hash, ''); $this->get(route('preview.hash', ['hash' => $skin->hash])) ->assertHeader('Content-Type', 'image/webp'); @@ -65,7 +65,7 @@ class TextureControllerTest extends TestCase $mock->shouldReceive('renderCape')->andReturn(Image::canvas(1, 1)); }); - $skin = factory(Texture::class)->create(); + $skin = Texture::factory()->create(); $this->get(route('preview.texture', ['texture' => $skin]))->assertNotFound(); $disk->put($skin->hash, ''); @@ -76,7 +76,7 @@ class TextureControllerTest extends TestCase ->assertHeader('Content-Type', 'image/png'); $this->assertTrue(Cache::has('preview-t'.$skin->tid.'-png')); - $cape = factory(Texture::class)->states('cape')->create(); + $cape = Texture::factory()->cape()->create(); $disk->put($cape->hash, ''); $this->get(route('preview.texture', ['texture' => $cape, 'height' => 100])) ->assertHeader('Content-Type', 'image/webp'); @@ -86,7 +86,7 @@ class TextureControllerTest extends TestCase public function testRaw() { $disk = Storage::fake('textures'); - $skin = factory(Texture::class)->create(); + $skin = Texture::factory()->create(); // Not found $this->get('/raw/0')->assertNotFound(); @@ -106,7 +106,7 @@ class TextureControllerTest extends TestCase public function testTexture() { $disk = Storage::fake('textures'); - $skin = factory(Texture::class)->create(); + $skin = Texture::factory()->create(); $this->get('/textures/'.$skin->hash)->assertNotFound(); @@ -125,7 +125,7 @@ class TextureControllerTest extends TestCase $this->get(route('avatar.player', ['name' => 'abc']))->assertNotFound(); - $player = factory(Player::class)->create(); + $player = Player::factory()->create(); $this->get(route('avatar.player', ['name' => $player->name])) ->assertSuccessful() ->assertHeader('Content-Type', 'image/webp'); @@ -133,7 +133,7 @@ class TextureControllerTest extends TestCase $this->mock(Minecraft::class, function ($mock) { $mock->shouldReceive('render2dAvatar')->andReturn(Image::canvas(1, 1)); }); - $texture = factory(Texture::class)->create(); + $texture = Texture::factory()->create(); $disk->put($texture->hash, ''); $player->tid_skin = $texture->tid; $player->save(); @@ -170,7 +170,7 @@ class TextureControllerTest extends TestCase ->assertSuccessful() ->assertHeader('Content-Type', 'image/webp'); - $user = factory(User::class)->create(); + $user = User::factory()->create(); $this->get(route('avatar.user', ['uid' => $user->uid])) ->assertSuccessful() ->assertHeader('Content-Type', 'image/webp'); @@ -178,7 +178,7 @@ class TextureControllerTest extends TestCase $this->mock(Minecraft::class, function ($mock) { $mock->shouldReceive('render2dAvatar')->andReturn(Image::canvas(1, 1)); }); - $texture = factory(Texture::class)->create(); + $texture = Texture::factory()->create(); $disk->put($texture->hash, ''); $user->avatar = $texture->tid; $user->save(); @@ -213,7 +213,7 @@ class TextureControllerTest extends TestCase $mock->shouldReceive('render3dAvatar')->andReturn(Image::canvas(1, 1)); }); - $texture = factory(Texture::class)->create(); + $texture = Texture::factory()->create(); $disk->put($texture->hash, ''); $this->get(route('avatar.hash', ['hash' => $texture->hash])) ->assertSuccessful() @@ -236,7 +236,7 @@ class TextureControllerTest extends TestCase $this->assertEquals(100, $image->width()); $this->assertEquals(100, $image->height()); - $texture = factory(Texture::class)->create(); + $texture = Texture::factory()->create(); $this->get(route('avatar.texture', ['tid' => $texture->tid])) ->assertSuccessful() ->assertHeader('Content-Type', 'image/webp'); diff --git a/tests/HttpTest/ControllersTest/TranslationsControllerTest.php b/tests/HttpTest/ControllersTest/TranslationsControllerTest.php index 74251747..df99e67a 100644 --- a/tests/HttpTest/ControllersTest/TranslationsControllerTest.php +++ b/tests/HttpTest/ControllersTest/TranslationsControllerTest.php @@ -2,6 +2,7 @@ namespace Tests; +use App\Models\User; use App\Services\Translations\JavaScript; use Illuminate\Foundation\Testing\DatabaseTransactions; use Spatie\TranslationLoader\LanguageLine; @@ -13,7 +14,7 @@ class TranslationsControllerTest extends TestCase protected function setUp(): void { parent::setUp(); - $this->actingAs(factory(\App\Models\User::class)->states('admin')->create()); + $this->actingAs(User::factory()->admin()->create()); } public function testList() diff --git a/tests/HttpTest/ControllersTest/UpdateControllerTest.php b/tests/HttpTest/ControllersTest/UpdateControllerTest.php index 005daac9..5e7de43c 100644 --- a/tests/HttpTest/ControllersTest/UpdateControllerTest.php +++ b/tests/HttpTest/ControllersTest/UpdateControllerTest.php @@ -2,6 +2,7 @@ namespace Tests; +use App\Models\User; use App\Services\Unzip; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Support\Facades\Http; @@ -13,7 +14,7 @@ class UpdateControllerTest extends TestCase protected function setUp(): void { parent::setUp(); - $this->actingAs(factory(\App\Models\User::class)->states('superAdmin')->create()); + $this->actingAs(User::factory()->superAdmin()->create()); } public function testShowUpdatePage() diff --git a/tests/HttpTest/ControllersTest/UserControllerTest.php b/tests/HttpTest/ControllersTest/UserControllerTest.php index bd63f939..11e73612 100644 --- a/tests/HttpTest/ControllersTest/UserControllerTest.php +++ b/tests/HttpTest/ControllersTest/UserControllerTest.php @@ -21,7 +21,7 @@ class UserControllerTest extends TestCase public function testUser() { - $user = factory(User::class)->create(); + $user = User::factory()->create(); $this->actingAs($user, 'jwt') ->get('/api/user') ->assertJson($user->toArray()); @@ -31,9 +31,9 @@ class UserControllerTest extends TestCase { $filter = Fakes\Filter::fake(); - $user = factory(User::class)->create(); + $user = User::factory()->create(); $uid = $user->uid; - factory(\App\Models\Player::class)->create(['uid' => $uid]); + \App\Models\Player::factory()->create(['uid' => $uid]); $converter = new GithubFlavoredMarkdownConverter(); $announcement = $converter->convertToHtml(option_localized('announcement')); @@ -48,7 +48,7 @@ class UserControllerTest extends TestCase return true; }); - $unverified = factory(User::class)->create(['verified' => false]); + $unverified = User::factory()->create(['verified' => false]); $this->actingAs($unverified) ->get('/user') ->assertDontSee(trans('user.verification.notice.title')); @@ -56,8 +56,8 @@ class UserControllerTest extends TestCase public function testScoreInfo() { - $user = factory(User::class)->create(); - factory(\App\Models\Player::class)->create(['uid' => $user->uid]); + $user = User::factory()->create(); + \App\Models\Player::factory()->create(['uid' => $user->uid]); $this->actingAs($user) ->get('/user/score-info') @@ -84,7 +84,7 @@ class UserControllerTest extends TestCase Event::fake(); $filter = Fakes\Filter::fake(); option(['sign_score' => '50,50']); - $user = factory(User::class)->create(); + $user = User::factory()->create(); // success $this->actingAs($user) @@ -114,7 +114,7 @@ class UserControllerTest extends TestCase // remaining time is greater than 0 Event::fake(); - $user = factory(User::class)->create(['last_sign_at' => Carbon::now()]); + $user = User::factory()->create(['last_sign_at' => Carbon::now()]); option(['sign_gap_time' => 2]); $this->actingAs($user) ->postJson('/user/sign') @@ -125,14 +125,14 @@ class UserControllerTest extends TestCase // can sign after 0 o'clock Event::fake(); option(['sign_after_zero' => true]); - $user = factory(User::class)->create(['last_sign_at' => Carbon::now()]); + $user = User::factory()->create(['last_sign_at' => Carbon::now()]); $this->actingAs($user) ->postJson('/user/sign') ->assertJson(['code' => 1]); Event::assertNotDispatched('user.sign.before'); Event::assertNotDispatched('user.sign.after'); - $user = factory(User::class)->create([ + $user = User::factory()->create([ 'last_sign_at' => Carbon::today(), ]); $this->actingAs($user) @@ -155,8 +155,8 @@ class UserControllerTest extends TestCase { Mail::fake(); - $unverified = factory(User::class)->create(['verified' => false]); - $verified = factory(User::class)->create(); + $unverified = User::factory()->create(['verified' => false]); + $verified = User::factory()->create(); // Should be forbidden if account verification is disabled option(['require_verification' => false]); @@ -222,7 +222,7 @@ class UserControllerTest extends TestCase { $filter = Fakes\Filter::fake(); - $this->actingAs(factory(User::class)->create()) + $this->actingAs(User::factory()->create()) ->get('/user/profile') ->assertViewIs('user.profile'); $filter->assertApplied('grid:user.profile'); @@ -231,7 +231,7 @@ class UserControllerTest extends TestCase public function testHandleProfile() { Event::fake(); - $user = factory(User::class)->create(); + $user = User::factory()->create(); $user->changePassword('12345678'); $uid = $user->uid; @@ -495,7 +495,7 @@ class UserControllerTest extends TestCase $this->assertNull(User::find($user->uid)); // Administrator cannot be deleted - $this->actingAs(factory(User::class)->states('admin')->create()) + $this->actingAs(User::factory()->admin()->create()) ->postJson('/user/profile', [ 'action' => 'delete', 'password' => '87654321', @@ -507,10 +507,10 @@ class UserControllerTest extends TestCase public function testSetAvatar() { - $user = factory(User::class)->create(); + $user = User::factory()->create(); $uid = $user->uid; - $steve = factory(Texture::class)->create(); - $cape = factory(Texture::class)->states('cape')->create(); + $steve = Texture::factory()->create(); + $cape = Texture::factory()->cape()->create(); // without `tid` field $this->actingAs($user) @@ -539,7 +539,7 @@ class UserControllerTest extends TestCase ]); // use private texture - $private = factory(Texture::class)->state('private')->create(); + $private = Texture::factory()->private()->create(); $this->actingAs($user) ->postJson('/user/profile/avatar', ['tid' => $private->tid]) ->assertJson([ diff --git a/tests/HttpTest/ControllersTest/UsersManagementControllerTest.php b/tests/HttpTest/ControllersTest/UsersManagementControllerTest.php index 2f635e04..4b7623af 100644 --- a/tests/HttpTest/ControllersTest/UsersManagementControllerTest.php +++ b/tests/HttpTest/ControllersTest/UsersManagementControllerTest.php @@ -14,12 +14,12 @@ class UsersManagementControllerTest extends TestCase protected function setUp(): void { parent::setUp(); - $this->actingAs(factory(User::class)->states('admin')->create()); + $this->actingAs(User::factory()->admin()->create()); } public function testList() { - $user = factory(User::class)->create(); + $user = User::factory()->create(); $this->getJson(route('admin.users.list')) ->assertJson(['data' => [[/* admin is here */], $user->toArray()]]); @@ -28,7 +28,7 @@ class UsersManagementControllerTest extends TestCase public function testAccessControl() { // an administrator operating on other administrator should be forbidden - $otherAdmin = factory(User::class)->states('admin')->create(); + $otherAdmin = User::factory()->admin()->create(); $this->putJson(route('admin.users.email', ['user' => $otherAdmin->uid])) ->assertJson([ @@ -40,7 +40,7 @@ class UsersManagementControllerTest extends TestCase public function testEmail() { - $user = factory(User::class)->create(); + $user = User::factory()->create(); // without `email` field $this->putJson(route('admin.users.email', ['user' => $user])) @@ -53,7 +53,7 @@ class UsersManagementControllerTest extends TestCase )->assertJsonValidationErrors(['email']); // use an existed email address - $other = factory(User::class)->create(); + $other = User::factory()->create(); $this->putJson( route('admin.users.email', ['user' => $user]), ['email' => $other->email] @@ -89,7 +89,7 @@ class UsersManagementControllerTest extends TestCase public function testVerification() { Event::fake(); - $user = factory(User::class)->create(); + $user = User::factory()->create(); $this->putJson( route('admin.users.verification', ['user' => $user]) @@ -116,7 +116,7 @@ class UsersManagementControllerTest extends TestCase public function testNickname() { - $user = factory(User::class)->create(); + $user = User::factory()->create(); // without `nickname` field $this->putJson( @@ -152,7 +152,7 @@ class UsersManagementControllerTest extends TestCase public function testPassword() { - $user = factory(User::class)->create(); + $user = User::factory()->create(); // without `password` field $this->putJson( @@ -196,7 +196,7 @@ class UsersManagementControllerTest extends TestCase public function testScore() { - $user = factory(User::class)->create(); + $user = User::factory()->create(); // without `score` field $this->putJson( @@ -238,7 +238,7 @@ class UsersManagementControllerTest extends TestCase public function testPermission() { - $user = factory(User::class)->create(); + $user = User::factory()->create(); // without `permission` field $this->putJson(route('admin.users.permission', ['user' => $user])) @@ -300,7 +300,7 @@ class UsersManagementControllerTest extends TestCase public function testDelete() { Event::fake(); - $user = factory(User::class)->create(); + $user = User::factory()->create(); $this->deleteJson(route('admin.users.delete', ['user' => $user])) ->assertJson([ diff --git a/tests/HttpTest/MiddlewareTest/AuthenticateTest.php b/tests/HttpTest/MiddlewareTest/AuthenticateTest.php index d97a733b..1b96f067 100644 --- a/tests/HttpTest/MiddlewareTest/AuthenticateTest.php +++ b/tests/HttpTest/MiddlewareTest/AuthenticateTest.php @@ -10,7 +10,7 @@ class AuthenticateTest extends TestCase { $this->get('/user')->assertRedirect('auth/login'); - $user = factory(User::class)->make(); + $user = User::factory()->make(); $this->actingAs($user)->assertAuthenticated(); } } diff --git a/tests/HttpTest/MiddlewareTest/CheckRoleTest.php b/tests/HttpTest/MiddlewareTest/CheckRoleTest.php index e7046d86..7e5b56c7 100644 --- a/tests/HttpTest/MiddlewareTest/CheckRoleTest.php +++ b/tests/HttpTest/MiddlewareTest/CheckRoleTest.php @@ -8,17 +8,17 @@ class CheckRole extends TestCase { public function testHandle() { - $this->actingAs(factory(User::class)->create()) + $this->actingAs(User::factory()->create()) ->get('/admin') ->assertForbidden(); - $this->actingAs(factory(User::class)->states('admin')->create()) + $this->actingAs(User::factory()->admin()->create()) ->get('/admin') ->assertSuccessful(); $this->get('/admin/update')->assertForbidden(); - $this->actingAs(factory(User::class)->states('superAdmin')->create()) + $this->actingAs(User::factory()->superAdmin()->create()) ->get('/admin/update') ->assertSuccessful(); } diff --git a/tests/HttpTest/MiddlewareTest/CheckUserVerifiedTest.php b/tests/HttpTest/MiddlewareTest/CheckUserVerifiedTest.php index a3389bd5..3d51ba86 100644 --- a/tests/HttpTest/MiddlewareTest/CheckUserVerifiedTest.php +++ b/tests/HttpTest/MiddlewareTest/CheckUserVerifiedTest.php @@ -11,7 +11,7 @@ class CheckUserVerifiedTest extends TestCase public function testHandle() { - $unverified = factory(User::class)->create(['verified' => false]); + $unverified = User::factory()->create(['verified' => false]); option(['require_verification' => false]); $this->actingAs($unverified) @@ -24,11 +24,11 @@ class CheckUserVerifiedTest extends TestCase ->assertStatus(403) ->assertSee(trans('auth.check.verified')); - $this->actingAs(factory(User::class)->create()) + $this->actingAs(User::factory()->create()) ->get('/skinlib/upload') ->assertSuccessful(); - $user = factory(User::class)->create(['verified' => false]); + $user = User::factory()->create(['verified' => false]); $this->actingAs($user)->get('/user/oauth/manage')->assertForbidden(); $this->getJson('/oauth/clients')->assertForbidden(); $user->verified = true; diff --git a/tests/HttpTest/MiddlewareTest/EnsureEmailFilledTest.php b/tests/HttpTest/MiddlewareTest/EnsureEmailFilledTest.php index ce5fdebf..eaff56f9 100644 --- a/tests/HttpTest/MiddlewareTest/EnsureEmailFilledTest.php +++ b/tests/HttpTest/MiddlewareTest/EnsureEmailFilledTest.php @@ -8,10 +8,10 @@ class EnsureEmailFilledTest extends TestCase { public function testHandle() { - $noEmailUser = factory(User::class)->make(['email' => '']); + $noEmailUser = User::factory()->make(['email' => '']); $this->actingAs($noEmailUser)->get('/user')->assertRedirect('/auth/bind'); - $normalUser = factory(User::class)->make(); + $normalUser = User::factory()->make(); $this->actingAs($normalUser)->get('/auth/bind')->assertRedirect('/user'); } } diff --git a/tests/HttpTest/MiddlewareTest/FireUserAuthenticatedTest.php b/tests/HttpTest/MiddlewareTest/FireUserAuthenticatedTest.php index a83c2451..3313bb70 100644 --- a/tests/HttpTest/MiddlewareTest/FireUserAuthenticatedTest.php +++ b/tests/HttpTest/MiddlewareTest/FireUserAuthenticatedTest.php @@ -10,7 +10,7 @@ class FireUserAuthenticatedTest extends TestCase public function testHandle() { Event::fake(); - $user = factory(User::class)->make(); + $user = User::factory()->make(); $this->actingAs($user)->get('/user'); Event::assertDispatched(\App\Events\UserAuthenticated::class, function ($event) use ($user) { $this->assertEquals($user->uid, $event->user->uid); diff --git a/tests/HttpTest/MiddlewareTest/RedirectIfAuthenticatedTest.php b/tests/HttpTest/MiddlewareTest/RedirectIfAuthenticatedTest.php index 2d06bba0..7894230d 100644 --- a/tests/HttpTest/MiddlewareTest/RedirectIfAuthenticatedTest.php +++ b/tests/HttpTest/MiddlewareTest/RedirectIfAuthenticatedTest.php @@ -12,7 +12,7 @@ class RedirectIfAuthenticatedTest extends TestCase ->assertViewIs('auth.login') ->assertDontSee(trans('general.user-center')); - $this->actingAs(factory(User::class)->make()) + $this->actingAs(User::factory()->make()) ->get('/auth/login') ->assertRedirect('/user'); } diff --git a/tests/HttpTest/MiddlewareTest/RejectBannedUserTest.php b/tests/HttpTest/MiddlewareTest/RejectBannedUserTest.php index 4c09eed6..bd0a4fa0 100644 --- a/tests/HttpTest/MiddlewareTest/RejectBannedUserTest.php +++ b/tests/HttpTest/MiddlewareTest/RejectBannedUserTest.php @@ -8,7 +8,7 @@ class RejectBannedUserTest extends TestCase { public function testHandle() { - $user = factory(User::class)->states('banned')->make(); + $user = User::factory()->banned()->create(); $this->actingAs($user)->get('/user')->assertForbidden(); $this->get('/user', ['accept' => 'application/json']) ->assertForbidden() diff --git a/tests/HttpTest/ViewTest/ComposersTest/FootComposerTest.php b/tests/HttpTest/ViewTest/ComposersTest/FootComposerTest.php index 43ae93e2..ac76ccc4 100644 --- a/tests/HttpTest/ViewTest/ComposersTest/FootComposerTest.php +++ b/tests/HttpTest/ViewTest/ComposersTest/FootComposerTest.php @@ -18,7 +18,7 @@ class FootComposerTest extends TestCase option([ 'custom_js' => '"
"