diff --git a/composer.json b/composer.json index bf5cc964..f9b04419 100644 --- a/composer.json +++ b/composer.json @@ -49,6 +49,7 @@ }, "require-dev": { "dms/phpunit-arraysubset-asserts": "^0.3.0", + "fakerphp/faker": "^1.14.1", "filp/whoops": "^2.12", "phpunit/phpunit": "^9.5", "squizlabs/php_codesniffer": "^3.6", @@ -65,6 +66,7 @@ }, "autoload-dev": { "psr-4": { + "Database\\Factories\\Engelsystem\\Models\\": "db/factories/", "Engelsystem\\Test\\": "tests/" } } diff --git a/composer.lock b/composer.lock index 6a782e5f..c8dc306c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "bd34e2ff922af485d95930ce692d1549", + "content-hash": "ed2a8819c2b212ab9d781824a12d7120", "packages": [ { "name": "composer/package-versions-deprecated", - "version": "1.11.99.1", + "version": "1.11.99.2", "source": { "type": "git", "url": "https://github.com/composer/package-versions-deprecated.git", - "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6" + "reference": "c6522afe5540d5fc46675043d3ed5a45a740b27c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/7413f0b55a051e89485c5cb9f765fe24bb02a7b6", - "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/c6522afe5540d5fc46675043d3ed5a45a740b27c", + "reference": "c6522afe5540d5fc46675043d3ed5a45a740b27c", "shasum": "" }, "require": { @@ -61,7 +61,7 @@ "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", "support": { "issues": "https://github.com/composer/package-versions-deprecated/issues", - "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.1" + "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.2" }, "funding": [ { @@ -77,20 +77,20 @@ "type": "tidelift" } ], - "time": "2020-11-11T10:22:58+00:00" + "time": "2021-05-24T07:46:03+00:00" }, { "name": "doctrine/cache", - "version": "1.11.0", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "a9c1b59eba5a08ca2770a76eddb88922f504e8e0" + "reference": "c9622c6820d3ede1e2315a6a377ea1076e421d88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/a9c1b59eba5a08ca2770a76eddb88922f504e8e0", - "reference": "a9c1b59eba5a08ca2770a76eddb88922f504e8e0", + "url": "https://api.github.com/repos/doctrine/cache/zipball/c9622c6820d3ede1e2315a6a377ea1076e421d88", + "reference": "c9622c6820d3ede1e2315a6a377ea1076e421d88", "shasum": "" }, "require": { @@ -160,7 +160,7 @@ ], "support": { "issues": "https://github.com/doctrine/cache/issues", - "source": "https://github.com/doctrine/cache/tree/1.11.0" + "source": "https://github.com/doctrine/cache/tree/2.0.3" }, "funding": [ { @@ -176,38 +176,39 @@ "type": "tidelift" } ], - "time": "2021-04-13T14:46:17+00:00" + "time": "2021-05-25T09:43:04+00:00" }, { "name": "doctrine/dbal", - "version": "3.1.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "5ba62e7e40df119424866064faf2cef66cb5232a" + "reference": "8e0fde2b90e3f61361013d1e928621beeea07bc0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/5ba62e7e40df119424866064faf2cef66cb5232a", - "reference": "5ba62e7e40df119424866064faf2cef66cb5232a", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/8e0fde2b90e3f61361013d1e928621beeea07bc0", + "reference": "8e0fde2b90e3f61361013d1e928621beeea07bc0", "shasum": "" }, "require": { "composer/package-versions-deprecated": "^1.11.99", - "doctrine/cache": "^1.0", + "doctrine/cache": "^1.0|^2.0", "doctrine/deprecations": "^0.5.3", "doctrine/event-manager": "^1.0", "php": "^7.3 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "8.2.0", + "doctrine/coding-standard": "9.0.0", "jetbrains/phpstorm-stubs": "2020.2", "phpstan/phpstan": "0.12.81", "phpstan/phpstan-strict-rules": "^0.12.2", - "phpunit/phpunit": "9.5.0", + "phpunit/phpunit": "9.5.5", "psalm/plugin-phpunit": "0.13.0", "squizlabs/php_codesniffer": "3.6.0", - "symfony/console": "^2.0.5|^3.0|^4.0|^5.0", + "symfony/cache": "^5.2|^6.0", + "symfony/console": "^2.0.5|^3.0|^4.0|^5.0|^6.0", "vimeo/psalm": "4.6.4" }, "suggest": { @@ -268,7 +269,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.1.0" + "source": "https://github.com/doctrine/dbal/tree/3.1.1" }, "funding": [ { @@ -284,7 +285,7 @@ "type": "tidelift" } ], - "time": "2021-04-19T17:51:23+00:00" + "time": "2021-06-19T17:59:55+00:00" }, { "name": "doctrine/deprecations", @@ -1202,16 +1203,16 @@ }, { "name": "illuminate/collections", - "version": "v8.41.0", + "version": "v8.48.2", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", - "reference": "deccb956d38710f3f8baf36dd876c3fa1585ec22" + "reference": "fe4a74465a43829d2067b7e7f9c49078506ff289" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/deccb956d38710f3f8baf36dd876c3fa1585ec22", - "reference": "deccb956d38710f3f8baf36dd876c3fa1585ec22", + "url": "https://api.github.com/repos/illuminate/collections/zipball/fe4a74465a43829d2067b7e7f9c49078506ff289", + "reference": "fe4a74465a43829d2067b7e7f9c49078506ff289", "shasum": "" }, "require": { @@ -1252,20 +1253,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-04-22T21:08:09+00:00" + "time": "2021-06-21T13:44:14+00:00" }, { "name": "illuminate/container", - "version": "v8.41.0", + "version": "v8.48.2", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", - "reference": "0e38ee1632d470e56aece0079e6e22d13e6bea8e" + "reference": "382959676d85583f0e8fdd248bceb4b8762dc1ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/container/zipball/0e38ee1632d470e56aece0079e6e22d13e6bea8e", - "reference": "0e38ee1632d470e56aece0079e6e22d13e6bea8e", + "url": "https://api.github.com/repos/illuminate/container/zipball/382959676d85583f0e8fdd248bceb4b8762dc1ed", + "reference": "382959676d85583f0e8fdd248bceb4b8762dc1ed", "shasum": "" }, "require": { @@ -1303,20 +1304,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-03-16T19:42:20+00:00" + "time": "2021-06-08T14:08:11+00:00" }, { "name": "illuminate/contracts", - "version": "v8.41.0", + "version": "v8.48.2", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", - "reference": "64abbe2aeee0855a11cfce49d0ea08a0aa967cd2" + "reference": "199fcedc161ba4a0b83feaddc4629f395dbf1641" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/64abbe2aeee0855a11cfce49d0ea08a0aa967cd2", - "reference": "64abbe2aeee0855a11cfce49d0ea08a0aa967cd2", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/199fcedc161ba4a0b83feaddc4629f395dbf1641", + "reference": "199fcedc161ba4a0b83feaddc4629f395dbf1641", "shasum": "" }, "require": { @@ -1351,20 +1352,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-05-06T14:58:48+00:00" + "time": "2021-06-01T14:53:38+00:00" }, { "name": "illuminate/database", - "version": "v8.41.0", + "version": "v8.48.2", "source": { "type": "git", "url": "https://github.com/illuminate/database.git", - "reference": "6277b39728bce436d2509d215223137d87265792" + "reference": "af20e1ceefd532b35ed5b24b3b4c8b305d8fb42b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/database/zipball/6277b39728bce436d2509d215223137d87265792", - "reference": "6277b39728bce436d2509d215223137d87265792", + "url": "https://api.github.com/repos/illuminate/database/zipball/af20e1ceefd532b35ed5b24b3b4c8b305d8fb42b", + "reference": "af20e1ceefd532b35ed5b24b3b4c8b305d8fb42b", "shasum": "" }, "require": { @@ -1419,11 +1420,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-05-11T13:24:37+00:00" + "time": "2021-06-25T23:56:55+00:00" }, { "name": "illuminate/macroable", - "version": "v8.41.0", + "version": "v8.48.2", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -1469,16 +1470,16 @@ }, { "name": "illuminate/support", - "version": "v8.41.0", + "version": "v8.48.2", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "31e91a12f0aac770d02a05b5d5771829132213b4" + "reference": "6d925ec70e060a5a16949c79216389c66746a07f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/31e91a12f0aac770d02a05b5d5771829132213b4", - "reference": "31e91a12f0aac770d02a05b5d5771829132213b4", + "url": "https://api.github.com/repos/illuminate/support/zipball/6d925ec70e060a5a16949c79216389c66746a07f", + "reference": "6d925ec70e060a5a16949c79216389c66746a07f", "shasum": "" }, "require": { @@ -1533,7 +1534,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-05-10T13:42:57+00:00" + "time": "2021-06-17T16:03:38+00:00" }, { "name": "league/oauth2-client", @@ -1607,16 +1608,16 @@ }, { "name": "nesbot/carbon", - "version": "2.48.0", + "version": "2.49.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "d3c447f21072766cddec3522f9468a5849a76147" + "reference": "93d9db91c0235c486875d22f1e08b50bdf3e6eee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d3c447f21072766cddec3522f9468a5849a76147", - "reference": "d3c447f21072766cddec3522f9468a5849a76147", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/93d9db91c0235c486875d22f1e08b50bdf3e6eee", + "reference": "93d9db91c0235c486875d22f1e08b50bdf3e6eee", "shasum": "" }, "require": { @@ -1696,7 +1697,7 @@ "type": "tidelift" } ], - "time": "2021-05-07T10:08:30+00:00" + "time": "2021-06-02T07:31:40+00:00" }, { "name": "nikic/fast-route", @@ -2609,20 +2610,21 @@ }, { "name": "symfony/console", - "version": "v5.2.8", + "version": "v5.3.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "864568fdc0208b3eba3638b6000b69d2386e6768" + "reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/864568fdc0208b3eba3638b6000b69d2386e6768", - "reference": "864568fdc0208b3eba3638b6000b69d2386e6768", + "url": "https://api.github.com/repos/symfony/console/zipball/649730483885ff2ca99ca0560ef0e5f6b03f2ac1", + "reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1", "shasum": "" }, "require": { "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", "symfony/polyfill-php80": "^1.15", @@ -2686,7 +2688,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.2.8" + "source": "https://github.com/symfony/console/tree/v5.3.2" }, "funding": [ { @@ -2702,7 +2704,7 @@ "type": "tidelift" } ], - "time": "2021-05-11T15:45:21+00:00" + "time": "2021-06-12T09:42:48+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2773,16 +2775,16 @@ }, { "name": "symfony/http-foundation", - "version": "v5.2.8", + "version": "v5.3.2", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "e8fbbab7c4a71592985019477532629cb2e142dc" + "reference": "7b6dd714d95106b831aaa7f3c9c612ab886516bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e8fbbab7c4a71592985019477532629cb2e142dc", - "reference": "e8fbbab7c4a71592985019477532629cb2e142dc", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/7b6dd714d95106b831aaa7f3c9c612ab886516bd", + "reference": "7b6dd714d95106b831aaa7f3c9c612ab886516bd", "shasum": "" }, "require": { @@ -2826,7 +2828,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v5.2.8" + "source": "https://github.com/symfony/http-foundation/tree/v5.3.2" }, "funding": [ { @@ -2842,20 +2844,20 @@ "type": "tidelift" } ], - "time": "2021-05-07T13:41:16+00:00" + "time": "2021-06-12T10:15:17+00:00" }, { "name": "symfony/mime", - "version": "v5.2.7", + "version": "v5.3.2", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "7af452bf51c46f18da00feb32e1ad36db9426515" + "reference": "47dd7912152b82d0d4c8d9040dbc93d6232d472a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/7af452bf51c46f18da00feb32e1ad36db9426515", - "reference": "7af452bf51c46f18da00feb32e1ad36db9426515", + "url": "https://api.github.com/repos/symfony/mime/zipball/47dd7912152b82d0d4c8d9040dbc93d6232d472a", + "reference": "47dd7912152b82d0d4c8d9040dbc93d6232d472a", "shasum": "" }, "require": { @@ -2909,7 +2911,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v5.2.7" + "source": "https://github.com/symfony/mime/tree/v5.3.2" }, "funding": [ { @@ -2925,20 +2927,20 @@ "type": "tidelift" } ], - "time": "2021-04-29T20:47:09+00:00" + "time": "2021-06-09T10:58:01+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e" + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", "shasum": "" }, "require": { @@ -2950,7 +2952,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2988,7 +2990,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" }, "funding": [ { @@ -3004,20 +3006,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-iconv", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "06fb361659649bcfd6a208a0f1fcaf4e827ad342" + "reference": "63b5bb7db83e5673936d6e3b8b3e022ff6474933" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/06fb361659649bcfd6a208a0f1fcaf4e827ad342", - "reference": "06fb361659649bcfd6a208a0f1fcaf4e827ad342", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/63b5bb7db83e5673936d6e3b8b3e022ff6474933", + "reference": "63b5bb7db83e5673936d6e3b8b3e022ff6474933", "shasum": "" }, "require": { @@ -3029,7 +3031,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3068,7 +3070,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-iconv/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-iconv/tree/v1.23.0" }, "funding": [ { @@ -3084,20 +3086,20 @@ "type": "tidelift" } ], - "time": "2021-01-22T09:19:47+00:00" + "time": "2021-05-27T09:27:20+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "5601e09b69f26c1828b13b6bb87cb07cddba3170" + "reference": "24b72c6baa32c746a4d0840147c9715e42bb68ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/5601e09b69f26c1828b13b6bb87cb07cddba3170", - "reference": "5601e09b69f26c1828b13b6bb87cb07cddba3170", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/24b72c6baa32c746a4d0840147c9715e42bb68ab", + "reference": "24b72c6baa32c746a4d0840147c9715e42bb68ab", "shasum": "" }, "require": { @@ -3109,7 +3111,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3149,7 +3151,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.0" }, "funding": [ { @@ -3165,20 +3167,20 @@ "type": "tidelift" } ], - "time": "2021-01-22T09:19:47+00:00" + "time": "2021-05-27T09:17:38+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "2d63434d922daf7da8dd863e7907e67ee3031483" + "reference": "65bd267525e82759e7d8c4e8ceea44f398838e65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/2d63434d922daf7da8dd863e7907e67ee3031483", - "reference": "2d63434d922daf7da8dd863e7907e67ee3031483", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/65bd267525e82759e7d8c4e8ceea44f398838e65", + "reference": "65bd267525e82759e7d8c4e8ceea44f398838e65", "shasum": "" }, "require": { @@ -3192,7 +3194,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3236,7 +3238,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.23.0" }, "funding": [ { @@ -3252,20 +3254,20 @@ "type": "tidelift" } ], - "time": "2021-01-22T09:19:47+00:00" + "time": "2021-05-27T09:27:20+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248" + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/43a0283138253ed1d48d352ab6d0bdb3f809f248", - "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", "shasum": "" }, "require": { @@ -3277,7 +3279,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3320,7 +3322,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" }, "funding": [ { @@ -3336,20 +3338,20 @@ "type": "tidelift" } ], - "time": "2021-01-22T09:19:47+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1" + "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2df51500adbaebdc4c38dea4c89a2e131c45c8a1", + "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1", "shasum": "" }, "require": { @@ -3361,7 +3363,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3400,7 +3402,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.0" }, "funding": [ { @@ -3416,20 +3418,20 @@ "type": "tidelift" } ], - "time": "2021-01-22T09:19:47+00:00" + "time": "2021-05-27T09:27:20+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9" + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", - "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", "shasum": "" }, "require": { @@ -3438,7 +3440,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3476,7 +3478,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" }, "funding": [ { @@ -3492,20 +3494,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-05-27T09:17:38+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2" + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", - "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", "shasum": "" }, "require": { @@ -3514,7 +3516,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3555,7 +3557,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" }, "funding": [ { @@ -3571,20 +3573,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" + "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0", + "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0", "shasum": "" }, "require": { @@ -3593,7 +3595,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3638,7 +3640,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0" }, "funding": [ { @@ -3654,7 +3656,7 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/psr-http-message-bridge", @@ -3825,16 +3827,16 @@ }, { "name": "symfony/string", - "version": "v5.2.8", + "version": "v5.3.2", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "01b35eb64cac8467c3f94cd0ce2d0d376bb7d1db" + "reference": "0732e97e41c0a590f77e231afc16a327375d50b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/01b35eb64cac8467c3f94cd0ce2d0d376bb7d1db", - "reference": "01b35eb64cac8467c3f94cd0ce2d0d376bb7d1db", + "url": "https://api.github.com/repos/symfony/string/zipball/0732e97e41c0a590f77e231afc16a327375d50b0", + "reference": "0732e97e41c0a590f77e231afc16a327375d50b0", "shasum": "" }, "require": { @@ -3888,7 +3890,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.2.8" + "source": "https://github.com/symfony/string/tree/v5.3.2" }, "funding": [ { @@ -3904,24 +3906,25 @@ "type": "tidelift" } ], - "time": "2021-05-10T14:56:10+00:00" + "time": "2021-06-06T09:51:56+00:00" }, { "name": "symfony/translation", - "version": "v5.2.8", + "version": "v5.3.2", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "445caa74a5986f1cc9dd91a2975ef68fa7cb2068" + "reference": "7e2603bcc598e14804c4d2359d8dc4ee3c40391b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/445caa74a5986f1cc9dd91a2975ef68fa7cb2068", - "reference": "445caa74a5986f1cc9dd91a2975ef68fa7cb2068", + "url": "https://api.github.com/repos/symfony/translation/zipball/7e2603bcc598e14804c4d2359d8dc4ee3c40391b", + "reference": "7e2603bcc598e14804c4d2359d8dc4ee3c40391b", "shasum": "" }, "require": { "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php80": "^1.15", "symfony/translation-contracts": "^2.3" @@ -3944,6 +3947,7 @@ "symfony/finder": "^4.4|^5.0", "symfony/http-kernel": "^5.0", "symfony/intl": "^4.4|^5.0", + "symfony/polyfill-intl-icu": "^1.21", "symfony/service-contracts": "^1.1.2|^2", "symfony/yaml": "^4.4|^5.0" }, @@ -3981,7 +3985,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v5.2.8" + "source": "https://github.com/symfony/translation/tree/v5.3.2" }, "funding": [ { @@ -3997,7 +4001,7 @@ "type": "tidelift" } ], - "time": "2021-05-07T13:41:16+00:00" + "time": "2021-06-06T09:51:56+00:00" }, { "name": "symfony/translation-contracts", @@ -4079,16 +4083,16 @@ }, { "name": "twig/twig", - "version": "v3.3.1", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "ac44433c49892bf28d47c852b19832f3823bd351" + "reference": "21578f00e83d4a82ecfa3d50752b609f13de6790" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/ac44433c49892bf28d47c852b19832f3823bd351", - "reference": "ac44433c49892bf28d47c852b19832f3823bd351", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/21578f00e83d4a82ecfa3d50752b609f13de6790", + "reference": "21578f00e83d4a82ecfa3d50752b609f13de6790", "shasum": "" }, "require": { @@ -4139,7 +4143,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.3.1" + "source": "https://github.com/twigphp/Twig/tree/v3.3.2" }, "funding": [ { @@ -4151,7 +4155,7 @@ "type": "tidelift" } ], - "time": "2021-05-12T08:05:35+00:00" + "time": "2021-05-16T12:14:13+00:00" }, { "name": "vlucas/phpdotenv", @@ -4423,18 +4427,83 @@ ], "time": "2020-11-10T18:47:58+00:00" }, + { + "name": "fakerphp/faker", + "version": "v1.14.1", + "source": { + "type": "git", + "url": "https://github.com/FakerPHP/Faker.git", + "reference": "ed22aee8d17c7b396f74a58b1e7fefa4f90d5ef1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/ed22aee8d17c7b396f74a58b1e7fefa4f90d5ef1", + "reference": "ed22aee8d17c7b396f74a58b1e7fefa4f90d5ef1", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "psr/container": "^1.0", + "symfony/deprecation-contracts": "^2.2" + }, + "conflict": { + "fzaninotto/faker": "*" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "ext-intl": "*", + "symfony/phpunit-bridge": "^4.4 || ^5.2" + }, + "suggest": { + "ext-curl": "Required by Faker\\Provider\\Image to download images.", + "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.", + "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.", + "ext-mbstring": "Required for multibyte Unicode string functionality." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "v1.15-dev" + } + }, + "autoload": { + "psr-4": { + "Faker\\": "src/Faker/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "François Zaninotto" + } + ], + "description": "Faker is a PHP library that generates fake data for you.", + "keywords": [ + "data", + "faker", + "fixtures" + ], + "support": { + "issues": "https://github.com/FakerPHP/Faker/issues", + "source": "https://github.com/FakerPHP/Faker/tree/v.1.14.1" + }, + "time": "2021-03-30T06:27:33+00:00" + }, { "name": "filp/whoops", - "version": "2.12.1", + "version": "2.13.0", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "c13c0be93cff50f88bbd70827d993026821914dd" + "reference": "2edbc73a4687d9085c8f20f398eebade844e8424" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/c13c0be93cff50f88bbd70827d993026821914dd", - "reference": "c13c0be93cff50f88bbd70827d993026821914dd", + "url": "https://api.github.com/repos/filp/whoops/zipball/2edbc73a4687d9085c8f20f398eebade844e8424", + "reference": "2edbc73a4687d9085c8f20f398eebade844e8424", "shasum": "" }, "require": { @@ -4484,7 +4553,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.12.1" + "source": "https://github.com/filp/whoops/tree/2.13.0" }, "funding": [ { @@ -4492,7 +4561,7 @@ "type": "github" } ], - "time": "2021-04-25T12:00:00+00:00" + "time": "2021-06-04T12:00:00+00:00" }, { "name": "myclabs/deep-copy", @@ -5264,16 +5333,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.4", + "version": "9.5.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "c73c6737305e779771147af66c96ca6a7ed8a741" + "reference": "fb9b8333f14e3dce976a60ef6a7e05c7c7ed8bfb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c73c6737305e779771147af66c96ca6a7ed8a741", - "reference": "c73c6737305e779771147af66c96ca6a7ed8a741", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fb9b8333f14e3dce976a60ef6a7e05c7c7ed8bfb", + "reference": "fb9b8333f14e3dce976a60ef6a7e05c7c7ed8bfb", "shasum": "" }, "require": { @@ -5303,7 +5372,7 @@ "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^2.3", + "sebastian/type": "^2.3.4", "sebastian/version": "^3.0.2" }, "require-dev": { @@ -5351,7 +5420,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.4" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.6" }, "funding": [ { @@ -5363,7 +5432,7 @@ "type": "github" } ], - "time": "2021-03-23T07:16:29+00:00" + "time": "2021-06-23T05:14:38+00:00" }, { "name": "sebastian/cli-parser", @@ -5871,16 +5940,16 @@ }, { "name": "sebastian/global-state", - "version": "5.0.2", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "a90ccbddffa067b51f574dea6eb25d5680839455" + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/a90ccbddffa067b51f574dea6eb25d5680839455", - "reference": "a90ccbddffa067b51f574dea6eb25d5680839455", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", "shasum": "" }, "require": { @@ -5923,7 +5992,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.2" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" }, "funding": [ { @@ -5931,7 +6000,7 @@ "type": "github" } ], - "time": "2020-10-26T15:55:19+00:00" + "time": "2021-06-11T13:31:12+00:00" }, { "name": "sebastian/lines-of-code", @@ -6222,16 +6291,16 @@ }, { "name": "sebastian/type", - "version": "2.3.1", + "version": "2.3.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2" + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/81cd61ab7bbf2de744aba0ea61fae32f721df3d2", - "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", "shasum": "" }, "require": { @@ -6266,7 +6335,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/2.3.1" + "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" }, "funding": [ { @@ -6274,7 +6343,7 @@ "type": "github" } ], - "time": "2020-10-26T13:18:59+00:00" + "time": "2021-06-15T12:49:02+00:00" }, { "name": "sebastian/version", @@ -6387,16 +6456,16 @@ }, { "name": "symfony/var-dumper", - "version": "v5.2.8", + "version": "v5.3.2", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "d693200a73fae179d27f8f1b16b4faf3e8569eba" + "reference": "905a22c68b292ffb6f20d7636c36b220d1fba5ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/d693200a73fae179d27f8f1b16b4faf3e8569eba", - "reference": "d693200a73fae179d27f8f1b16b4faf3e8569eba", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/905a22c68b292ffb6f20d7636c36b220d1fba5ae", + "reference": "905a22c68b292ffb6f20d7636c36b220d1fba5ae", "shasum": "" }, "require": { @@ -6455,7 +6524,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.2.8" + "source": "https://github.com/symfony/var-dumper/tree/v5.3.2" }, "funding": [ { @@ -6471,7 +6540,7 @@ "type": "tidelift" } ], - "time": "2021-05-07T13:42:21+00:00" + "time": "2021-06-06T09:51:56+00:00" }, { "name": "theseer/tokenizer", diff --git a/db/factories/User/ContactFactory.php b/db/factories/User/ContactFactory.php new file mode 100644 index 00000000..50557841 --- /dev/null +++ b/db/factories/User/ContactFactory.php @@ -0,0 +1,24 @@ + $this->faker->optional()->numberBetween(1000, 9999), + 'email' => $this->faker->unique()->optional()->safeEmail(), + 'mobile' => $this->faker->optional(.2)->phoneNumber(), + ]; + } +} diff --git a/db/factories/User/PasswordResetFactory.php b/db/factories/User/PasswordResetFactory.php new file mode 100644 index 00000000..08a02eb7 --- /dev/null +++ b/db/factories/User/PasswordResetFactory.php @@ -0,0 +1,22 @@ + md5($this->faker->unique()->password()), + ]; + } +} diff --git a/db/factories/User/PersonalDataFactory.php b/db/factories/User/PersonalDataFactory.php new file mode 100644 index 00000000..ec3144ac --- /dev/null +++ b/db/factories/User/PersonalDataFactory.php @@ -0,0 +1,31 @@ +faker->optional()->dateTimeThisMonth('2 weeks'); + $departure = $this->faker->optional()->dateTimeThisMonth('2 weeks'); + + return [ + 'first_name' => $this->faker->optional(.7)->firstName(), + 'last_name' => $this->faker->optional()->lastName(), + 'pronoun' => $this->faker->optional(.3)->pronoun(), + 'shirt_size' => $this->faker->optional(.9)->shirtSize(), + 'planned_arrival_date' => $arrival ? Carbon::instance($arrival) : null, + 'planned_departure_date' => $departure ? Carbon::instance($departure) : null, + ]; + } +} diff --git a/db/factories/User/SettingsFactory.php b/db/factories/User/SettingsFactory.php new file mode 100644 index 00000000..14df359f --- /dev/null +++ b/db/factories/User/SettingsFactory.php @@ -0,0 +1,26 @@ + $this->faker->locale(), + 'theme' => $this->faker->numberBetween(1, 20), + 'email_human' => $this->faker->boolean(), + 'email_shiftinfo' => $this->faker->boolean(), + 'email_news' => $this->faker->boolean(), + ]; + } +} diff --git a/db/factories/User/StateFactory.php b/db/factories/User/StateFactory.php new file mode 100644 index 00000000..ca208066 --- /dev/null +++ b/db/factories/User/StateFactory.php @@ -0,0 +1,47 @@ +faker->optional()->dateTimeThisMonth(); + + return [ + 'arrived' => (bool)$arrival, + 'arrival_date' => $arrival ? Carbon::instance($arrival) : null, + 'active' => $this->faker->boolean(.3), + 'force_active' => $this->faker->boolean(.1), + 'got_shirt' => $this->faker->boolean(), + 'got_voucher' => $this->faker->numberBetween(0, 10), + ]; + } + + /** + * Indicate that the user is arrived + * + * @return self + */ + public function arrived() + { + return $this->state( + function (array $attributes) { + return [ + 'arrived' => true, + 'arrival_date' => Carbon::instance($this->faker->dateTimeThisMonth()), + ]; + } + ); + } +} diff --git a/db/factories/User/UserFactory.php b/db/factories/User/UserFactory.php new file mode 100644 index 00000000..591d4574 --- /dev/null +++ b/db/factories/User/UserFactory.php @@ -0,0 +1,25 @@ + $this->faker->unique()->userName(), + 'password' => password_hash($this->faker->password(), PASSWORD_DEFAULT), + 'email' => $this->faker->unique()->safeEmail(), + 'api_key' => md5($this->faker->unique()->password()), + ]; + } +} diff --git a/src/Application.php b/src/Application.php index 99c68231..035cd001 100644 --- a/src/Application.php +++ b/src/Application.php @@ -6,6 +6,7 @@ use Engelsystem\Config\Config; use Engelsystem\Container\Container; use Engelsystem\Container\ServiceProvider; use Illuminate\Container\Container as IlluminateContainer; +use Illuminate\Contracts\Container\Container as IlluminateContainerContract; use Psr\Container\ContainerInterface; use Psr\Http\Server\MiddlewareInterface; @@ -50,6 +51,7 @@ class Application extends Container $this->instance(Container::class, $this); $this->instance(Application::class, $this); $this->instance(IlluminateContainer::class, $this); + $this->instance(IlluminateContainerContract::class, $this); $this->bind(ContainerInterface::class, self::class); } diff --git a/src/Controllers/Metrics/Stats.php b/src/Controllers/Metrics/Stats.php index 97711b4e..2733ba0c 100644 --- a/src/Controllers/Metrics/Stats.php +++ b/src/Controllers/Metrics/Stats.php @@ -334,7 +334,7 @@ class Stats $query->having($this->raw($having), '<=', $bucket); } - $return[$bucket] = $query->count($this->raw($count)); + $return[$bucket] = count($query->get($this->raw($count))); } return $return; diff --git a/src/Models/User/Contact.php b/src/Models/User/Contact.php index 8077350b..4583acf0 100644 --- a/src/Models/User/Contact.php +++ b/src/Models/User/Contact.php @@ -2,6 +2,7 @@ namespace Engelsystem\Models\User; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Query\Builder as QueryBuilder; /** @@ -15,6 +16,8 @@ use Illuminate\Database\Query\Builder as QueryBuilder; */ class Contact extends HasUserModel { + use HasFactory; + /** @var string The table associated with the model */ protected $table = 'users_contact'; diff --git a/src/Models/User/PasswordReset.php b/src/Models/User/PasswordReset.php index 7f694268..5adff6f5 100644 --- a/src/Models/User/PasswordReset.php +++ b/src/Models/User/PasswordReset.php @@ -3,6 +3,7 @@ namespace Engelsystem\Models\User; use Carbon\Carbon; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Query\Builder as QueryBuilder; /** @@ -14,6 +15,8 @@ use Illuminate\Database\Query\Builder as QueryBuilder; */ class PasswordReset extends HasUserModel { + use HasFactory; + /** @var bool enable timestamps for created_at */ public $timestamps = true; diff --git a/src/Models/User/PersonalData.php b/src/Models/User/PersonalData.php index 445a2ceb..cc89047a 100644 --- a/src/Models/User/PersonalData.php +++ b/src/Models/User/PersonalData.php @@ -3,6 +3,7 @@ namespace Engelsystem\Models\User; use Carbon\Carbon; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Query\Builder as QueryBuilder; /** @@ -22,6 +23,8 @@ use Illuminate\Database\Query\Builder as QueryBuilder; */ class PersonalData extends HasUserModel { + use HasFactory; + /** @var string The table associated with the model */ protected $table = 'users_personal_data'; diff --git a/src/Models/User/Settings.php b/src/Models/User/Settings.php index ca1c392f..1ad4a85b 100644 --- a/src/Models/User/Settings.php +++ b/src/Models/User/Settings.php @@ -2,6 +2,7 @@ namespace Engelsystem\Models\User; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Query\Builder as QueryBuilder; /** @@ -19,6 +20,8 @@ use Illuminate\Database\Query\Builder as QueryBuilder; */ class Settings extends HasUserModel { + use HasFactory; + /** @var string The table associated with the model */ protected $table = 'users_settings'; diff --git a/src/Models/User/State.php b/src/Models/User/State.php index 46660b7c..471b6758 100644 --- a/src/Models/User/State.php +++ b/src/Models/User/State.php @@ -3,6 +3,7 @@ namespace Engelsystem\Models\User; use Carbon\Carbon; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Query\Builder as QueryBuilder; /** @@ -22,6 +23,8 @@ use Illuminate\Database\Query\Builder as QueryBuilder; */ class State extends HasUserModel { + use HasFactory; + /** @var string The table associated with the model */ protected $table = 'users_state'; diff --git a/src/Models/User/User.php b/src/Models/User/User.php index 229cc4b1..4bec75d8 100644 --- a/src/Models/User/User.php +++ b/src/Models/User/User.php @@ -11,6 +11,7 @@ use Engelsystem\Models\OAuth; use Engelsystem\Models\Question; use Engelsystem\Models\Worklog; use Illuminate\Database\Eloquent\Collection; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasOne; use Illuminate\Database\Query\Builder as QueryBuilder; @@ -57,6 +58,8 @@ use Illuminate\Database\Query\Builder as QueryBuilder; */ class User extends BaseModel { + use HasFactory; + /** @var bool enable timestamps */ public $timestamps = true; diff --git a/tests/Unit/Controllers/Admin/NewsControllerTest.php b/tests/Unit/Controllers/Admin/NewsControllerTest.php index 087400cb..02ffbf17 100644 --- a/tests/Unit/Controllers/Admin/NewsControllerTest.php +++ b/tests/Unit/Controllers/Admin/NewsControllerTest.php @@ -283,15 +283,7 @@ class NewsControllerTest extends ControllerTest */ protected function addUser() { - $user = new User([ - 'name' => 'foo', - 'password' => '', - 'email' => '', - 'api_key' => '', - 'last_login_at' => null, - ]); - $user->forceFill(['id' => 42]); - $user->save(); + $user = User::factory(['id' => 42])->create(); $this->auth->expects($this->any()) ->method('user') diff --git a/tests/Unit/Controllers/Admin/QuestionsControllerTest.php b/tests/Unit/Controllers/Admin/QuestionsControllerTest.php index c23ad5e5..c3c46aaf 100644 --- a/tests/Unit/Controllers/Admin/QuestionsControllerTest.php +++ b/tests/Unit/Controllers/Admin/QuestionsControllerTest.php @@ -241,14 +241,7 @@ class QuestionsControllerTest extends ControllerTest $this->app->bind(UrlGeneratorInterface::class, UrlGenerator::class); - $this->user = new User([ - 'name' => 'foo', - 'password' => '', - 'email' => '', - 'api_key' => '', - 'last_login_at' => null, - ]); - $this->user->save(); + $this->user = User::factory()->create(); $this->setExpects($this->auth, 'user', null, $this->user, $this->any()); (new Question([ diff --git a/tests/Unit/Controllers/AuthControllerTest.php b/tests/Unit/Controllers/AuthControllerTest.php index 9853e0d3..673ca092 100644 --- a/tests/Unit/Controllers/AuthControllerTest.php +++ b/tests/Unit/Controllers/AuthControllerTest.php @@ -185,22 +185,9 @@ class AuthControllerTest extends TestCase */ protected function createUser(): User { - $user = new User([ - 'name' => 'foo', - 'password' => '', - 'email' => '', - 'api_key' => '', - 'last_login_at' => null, - ]); - $user->forceFill(['id' => 42]); - $user->save(); - - $settings = new Settings(['language' => 'de_DE', 'theme' => '']); - $settings->user() - ->associate($user) - ->save(); - - return $user; + return User::factory(['id' => 42]) + ->has(Settings::factory(['language' => 'de_DE'])) + ->create(); } /** diff --git a/tests/Unit/Controllers/NewsControllerTest.php b/tests/Unit/Controllers/NewsControllerTest.php index e63abe50..df0c977a 100644 --- a/tests/Unit/Controllers/NewsControllerTest.php +++ b/tests/Unit/Controllers/NewsControllerTest.php @@ -269,15 +269,7 @@ class NewsControllerTest extends TestCase */ protected function addUser() { - $user = new User([ - 'name' => 'foo', - 'password' => '', - 'email' => '', - 'api_key' => '', - 'last_login_at' => null, - ]); - $user->forceFill(['id' => 42]); - $user->save(); + $user = User::factory()->create(['id' => 42]); $this->auth->expects($this->any()) ->method('user') diff --git a/tests/Unit/Controllers/OAuthControllerTest.php b/tests/Unit/Controllers/OAuthControllerTest.php index 9d78db88..66181f55 100644 --- a/tests/Unit/Controllers/OAuthControllerTest.php +++ b/tests/Unit/Controllers/OAuthControllerTest.php @@ -494,36 +494,15 @@ class OAuthControllerTest extends TestCase $this->app->instance('session', $this->session); - $this->authenticatedUser = new User([ - 'name' => 'foo', - 'password' => '', - 'email' => 'foo@localhost', - 'api_key' => '', - 'last_login_at' => null, - ]); - $this->authenticatedUser->save(); + $this->authenticatedUser = User::factory()->create(); (new OAuth(['provider' => 'testprovider', 'identifier' => 'provider-user-identifier'])) ->user() ->associate($this->authenticatedUser) ->save(); - $this->otherUser = new User([ - 'name' => 'bar', - 'password' => '', - 'email' => 'bar@localhost', - 'api_key' => '', - 'last_login_at' => null, - ]); - $this->otherUser->save(); - - $this->otherAuthenticatedUser = new User([ - 'name' => 'baz', - 'password' => '', - 'email' => 'baz@localhost', - 'api_key' => '', - 'last_login_at' => null, - ]); - $this->otherAuthenticatedUser->save(); + $this->otherUser = User::factory()->create(); + + $this->otherAuthenticatedUser = User::factory()->create(); (new OAuth(['provider' => 'testprovider', 'identifier' => 'provider-baz-identifier'])) ->user() ->associate($this->otherAuthenticatedUser) diff --git a/tests/Unit/Controllers/PasswordResetControllerTest.php b/tests/Unit/Controllers/PasswordResetControllerTest.php index 4560cfe1..1b36beb9 100644 --- a/tests/Unit/Controllers/PasswordResetControllerTest.php +++ b/tests/Unit/Controllers/PasswordResetControllerTest.php @@ -256,15 +256,7 @@ class PasswordResetControllerTest extends TestCase */ protected function createUser(): User { - $user = new User([ - 'name' => 'foo', - 'password' => '', - 'email' => 'foo@bar.batz', - 'api_key' => '', - ]); - $user->save(); - - return $user; + return User::factory()->create(['email' => 'foo@bar.batz']); } /** diff --git a/tests/Unit/Controllers/QuestionsControllerTest.php b/tests/Unit/Controllers/QuestionsControllerTest.php index 193bcdf2..3e205680 100644 --- a/tests/Unit/Controllers/QuestionsControllerTest.php +++ b/tests/Unit/Controllers/QuestionsControllerTest.php @@ -90,14 +90,7 @@ class QuestionsControllerTest extends ControllerTest */ public function testDeleteNotOwn() { - $otherUser = new User([ - 'name' => 'bar', - 'password' => '', - 'email' => '.', - 'api_key' => '', - 'last_login_at' => null, - ]); - $otherUser->save(); + $otherUser = User::factory()->create(); (new Question([ 'user_id' => $otherUser->id, 'text' => 'Lorem?', @@ -189,14 +182,7 @@ class QuestionsControllerTest extends ControllerTest $this->app->bind(UrlGeneratorInterface::class, UrlGenerator::class); - $this->user = new User([ - 'name' => 'foo', - 'password' => '', - 'email' => '', - 'api_key' => '', - 'last_login_at' => null, - ]); - $this->user->save(); + $this->user = User::factory()->create(); $this->setExpects($this->auth, 'user', null, $this->user, $this->any()); (new Question([ diff --git a/tests/Unit/Controllers/SettingsControllerTest.php b/tests/Unit/Controllers/SettingsControllerTest.php index 4dead5ba..90b2dc10 100644 --- a/tests/Unit/Controllers/SettingsControllerTest.php +++ b/tests/Unit/Controllers/SettingsControllerTest.php @@ -313,12 +313,6 @@ class SettingsControllerTest extends TestCase $this->auth = $this->createMock(Authenticator::class); $this->app->instance(Authenticator::class, $this->auth); - $this->user = new User([ - 'name' => 'testuser', - 'email' => 'test@engelsystem.de', - 'password' => 'xxx', - 'api_key' => 'xxx' - ]); - $this->user->save(); + $this->user = User::factory()->create(); } } diff --git a/tests/Unit/Events/Listener/NewsTest.php b/tests/Unit/Events/Listener/NewsTest.php index e58553fb..0bbf4805 100644 --- a/tests/Unit/Events/Listener/NewsTest.php +++ b/tests/Unit/Events/Listener/NewsTest.php @@ -3,7 +3,6 @@ namespace Engelsystem\Test\Unit\Events\Listener; use Engelsystem\Events\Listener\News; -use Engelsystem\Helpers\Authenticator; use Engelsystem\Mail\EngelsystemMailer; use Engelsystem\Models\News as NewsModel; use Engelsystem\Models\User\Settings; @@ -80,22 +79,12 @@ class NewsTest extends TestCase $this->mailer = $this->createMock(EngelsystemMailer::class); $this->app->instance(EngelsystemMailer::class, $this->mailer); - $this->user = new User([ - 'name' => 'test', - 'password' => '', - 'email' => 'foo@bar.baz', - 'api_key' => '', - ]); - - $this->user->save(); - - $settings = new Settings([ - 'language' => '', - 'theme' => 1, - 'email_news' => true, - ]); - $settings->user() - ->associate($this->user) - ->save(); + $this->user = User::factory() + ->has(Settings::factory([ + 'language' => '', + 'theme' => 1, + 'email_news' => true, + ])) + ->create(); } } diff --git a/tests/Unit/FakerProvider.php b/tests/Unit/FakerProvider.php new file mode 100644 index 00000000..ca594696 --- /dev/null +++ b/tests/Unit/FakerProvider.php @@ -0,0 +1,30 @@ +createMock(Session::class); $userRepository = new User(); - (new User([ + User::factory([ 'name' => 'lorem', 'password' => password_hash('testing', PASSWORD_DEFAULT), 'email' => 'lorem@foo.bar', - 'api_key' => '', - ]))->save(); - (new User([ + ])->create(); + User::factory([ 'name' => 'ipsum', 'password' => '', - 'email' => 'ipsum@foo.bar', - 'api_key' => '', - ]))->save(); + ])->create(); $auth = new Authenticator($request, $session, $userRepository); $this->assertNull($auth->authenticate('not-existing', 'foo')); @@ -192,13 +189,11 @@ class AuthenticatorTest extends ServiceProviderTest { $this->initDatabase(); $password = password_hash('testing', PASSWORD_ARGON2I); - $user = new User([ + /** @var User $user */ + $user = User::factory([ 'name' => 'lorem', 'password' => $password, - 'email' => 'lorem@foo.bar', - 'api_key' => '', - ]); - $user->save(); + ])->create(); /** @var Authenticator|MockObject $auth */ $auth = $this->getMockBuilder(Authenticator::class) @@ -221,12 +216,11 @@ class AuthenticatorTest extends ServiceProviderTest public function testSetPassword() { $this->initDatabase(); - $user = new User([ + /** @var User $user */ + $user = User::factory([ 'name' => 'ipsum', 'password' => '', - 'email' => 'ipsum@foo.bar', - 'api_key' => '', - ]); + ])->create(); $user->save(); $auth = $this->getAuthenticator(); diff --git a/tests/Unit/Logger/UserAwareLoggerTest.php b/tests/Unit/Logger/UserAwareLoggerTest.php index 8a38e8f1..e53341cc 100644 --- a/tests/Unit/Logger/UserAwareLoggerTest.php +++ b/tests/Unit/Logger/UserAwareLoggerTest.php @@ -18,7 +18,7 @@ class UserAwareLoggerTest extends ServiceProviderTest */ public function testLog() { - $user = (new User())->forceFill(['id' => 1, 'name' => 'admin']); + $user = User::factory(['id' => 1, 'name' => 'admin'])->make(); /** @var LogEntry|MockObject $logEntry */ $logEntry = $this->getMockBuilder(LogEntry::class) diff --git a/tests/Unit/Mail/EngelsystemMailerTest.php b/tests/Unit/Mail/EngelsystemMailerTest.php index 1f4339b0..8d649004 100644 --- a/tests/Unit/Mail/EngelsystemMailerTest.php +++ b/tests/Unit/Mail/EngelsystemMailerTest.php @@ -47,21 +47,10 @@ class EngelsystemMailerTest extends TestCase { $this->initDatabase(); - $settings = new Settings([ - 'language' => 'de_DE', - 'theme' => '', - ]); - $contact = new Contact(['email' => null]); - $user = new User([ - 'id' => 42, - 'name' => 'username', - 'email' => 'foo@bar.baz', - 'password' => '', - 'api_key' => '', - ]); - $user->save(); - $settings->user()->associate($user)->save(); - $contact->user()->associate($user)->save(); + $user = User::factory(['email' => 'foo@bar.baz']) + ->has(Settings::factory(['language' => 'de_DE'])) + ->has(Contact::factory(['email' => null])) + ->create(); /** @var Renderer|MockObject $view */ $view = $this->createMock(Renderer::class); diff --git a/tests/Unit/Middleware/SetLocaleTest.php b/tests/Unit/Middleware/SetLocaleTest.php index 228d7d55..29041472 100644 --- a/tests/Unit/Middleware/SetLocaleTest.php +++ b/tests/Unit/Middleware/SetLocaleTest.php @@ -40,15 +40,13 @@ class SetLocaleTest extends TestCase /** @var ResponseInterface|MockObject $response */ $response = $this->getMockForAbstractClass(ResponseInterface::class); - $user = User::create([ - 'name' => 'user', - 'password' => '', - 'email' => 'foo@bar.baz', - 'api_key' => '', - ]); - $settings = new Settings(['language' => 'uf_UF', 'theme' => '']); - $settings->user()->associate($user); - $settings->save(); + /** @var User $user */ + $user = User::factory([ + 'name' => 'user', + 'email' => 'foo@bar.baz', + ]) + ->has(Settings::factory(['language' => 'uf_UF'])) + ->create(); $locale = 'te_ST'; diff --git a/tests/Unit/Models/MessageTest.php b/tests/Unit/Models/MessageTest.php index 13975771..86f7cd3b 100644 --- a/tests/Unit/Models/MessageTest.php +++ b/tests/Unit/Models/MessageTest.php @@ -34,19 +34,8 @@ class MessageTest extends ModelTest { parent::setUp(); - $this->user1 = User::create([ - 'name' => 'user1', - 'password' => '', - 'email' => 'user1@example.com', - 'api_key' => '', - ]); - - $this->user2 = User::create([ - 'name' => 'user2', - 'password' => '', - 'email' => 'user2@example.com', - 'api_key' => '', - ]); + $this->user1 = User::factory()->create(); + $this->user2 = User::factory()->create(); $this->message1 = Message::create([ 'user_id' => $this->user1->id, diff --git a/tests/Unit/Models/NewsCommentsTest.php b/tests/Unit/Models/NewsCommentsTest.php index 46d05bf8..0fd7700e 100644 --- a/tests/Unit/Models/NewsCommentsTest.php +++ b/tests/Unit/Models/NewsCommentsTest.php @@ -29,12 +29,7 @@ class NewsCommentsTest extends ModelTest { parent::setUp(); - $this->user = User::create([ - 'name' => 'lorem', - 'password' => '', - 'email' => 'lorem@example.com', - 'api_key' => '', - ]); + $this->user = User::factory()->create(); $this->news = News::create([ 'title' => 'test title', diff --git a/tests/Unit/Models/NewsTest.php b/tests/Unit/Models/NewsTest.php index d99a470e..483ebf65 100644 --- a/tests/Unit/Models/NewsTest.php +++ b/tests/Unit/Models/NewsTest.php @@ -25,13 +25,7 @@ class NewsTest extends ModelTest { parent::setUp(); - $this->user = (new User())->create([ - 'name' => 'lorem', - 'password' => '', - 'email' => 'foo@bar.batz', - 'api_key' => '', - ]); - + $this->user = User::factory()->create(); $this->newsData = [ 'title' => 'test title', 'text' => 'test text', diff --git a/tests/Unit/Models/QuestionTest.php b/tests/Unit/Models/QuestionTest.php index f47f904c..e05aba83 100644 --- a/tests/Unit/Models/QuestionTest.php +++ b/tests/Unit/Models/QuestionTest.php @@ -28,23 +28,8 @@ class QuestionTest extends ModelTest { parent::setUp(); - $this->user1 = User::create( - [ - 'name' => 'user1', - 'password' => '', - 'email' => 'user1@example.com', - 'api_key' => '', - ] - ); - - $this->user2 = User::create( - [ - 'name' => 'user2', - 'password' => '', - 'email' => 'user2@example.com', - 'api_key' => '', - ] - ); + $this->user1 = User::factory()->create(); + $this->user2 = User::factory()->create(); } /** diff --git a/tests/Unit/Models/WorklogTest.php b/tests/Unit/Models/WorklogTest.php index a062bf00..88ef2a71 100644 --- a/tests/Unit/Models/WorklogTest.php +++ b/tests/Unit/Models/WorklogTest.php @@ -15,18 +15,8 @@ class WorklogTest extends ModelTest */ public function testCreator(): void { - $user1 = User::create([ - 'name' => 'user1', - 'password' => '', - 'email' => 'user1@example.com', - 'api_key' => '', - ]); - $user2 = User::create([ - 'name' => 'user2', - 'password' => '', - 'email' => 'user2@example.com', - 'api_key' => '', - ]); + $user1 = User::factory()->create(); + $user2 = User::factory()->create(); $worklog = new Worklog(); $worklog->user()->associate($user1); diff --git a/tests/Unit/Renderer/Twig/Extensions/AuthenticationTest.php b/tests/Unit/Renderer/Twig/Extensions/AuthenticationTest.php index 266b038e..e444fcca 100644 --- a/tests/Unit/Renderer/Twig/Extensions/AuthenticationTest.php +++ b/tests/Unit/Renderer/Twig/Extensions/AuthenticationTest.php @@ -34,7 +34,7 @@ class AuthenticationTest extends ExtensionTest { /** @var Authenticator|MockObject $auth */ $auth = $this->createMock(Authenticator::class); - $user = new User(); + $user = User::factory()->make(); $auth->expects($this->exactly(4)) ->method('user') diff --git a/tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php b/tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php index 39a02dd4..d1bb840e 100644 --- a/tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php +++ b/tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php @@ -3,9 +3,9 @@ namespace Engelsystem\Test\Unit\Renderer\Twig\Extensions; use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts; +use Engelsystem\Test\Unit\TestCase; use Exception; use PHPUnit\Framework\MockObject\MockObject; -use PHPUnit\Framework\TestCase; use Twig\Node\Node as TwigNode; use Twig\TwigFunction; diff --git a/tests/Unit/Renderer/Twig/Extensions/GlobalsTest.php b/tests/Unit/Renderer/Twig/Extensions/GlobalsTest.php index 4a97e798..08918fe3 100644 --- a/tests/Unit/Renderer/Twig/Extensions/GlobalsTest.php +++ b/tests/Unit/Renderer/Twig/Extensions/GlobalsTest.php @@ -20,7 +20,7 @@ class GlobalsTest extends ExtensionTest $auth = $this->createMock(Authenticator::class); /** @var Request|MockObject $request */ $request = $this->createMock(Request::class); - $user = new User(); + $user = User::factory()->make(); $auth->expects($this->exactly(2)) ->method('user') diff --git a/tests/Unit/TestCase.php b/tests/Unit/TestCase.php index dba8c989..27357d29 100644 --- a/tests/Unit/TestCase.php +++ b/tests/Unit/TestCase.php @@ -3,6 +3,8 @@ namespace Engelsystem\Test\Unit; use Engelsystem\Application; +use Faker\Factory as FakerFactory; +use Faker\Generator; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\Rule\InvocationOrder; use PHPUnit\Framework\TestCase as PHPUnitTestCase; @@ -45,5 +47,9 @@ abstract class TestCase extends PHPUnitTestCase protected function setUp(): void { $this->app = new Application(__DIR__ . '/../../'); + + $faker = FakerFactory::create(); + $faker->addProvider(new FakerProvider($faker)); + $this->app->instance(Generator::class, $faker); } }