Compare commits

..

2 commits

Author SHA1 Message Date
9afa7fe431
#29: add more tests
All checks were successful
/ ls (pull_request) Successful in 37s
/ ls (push) Successful in 32s
2024-07-10 22:18:56 +02:00
c4cd275c83
#29: add test for homecontroller 2024-07-10 19:05:28 +02:00
8 changed files with 395 additions and 177 deletions

View file

@ -11,6 +11,7 @@
"doctrine/doctrine-bundle": "^2.12",
"doctrine/doctrine-migrations-bundle": "^3.3",
"doctrine/orm": "^3.2",
"psr/clock": "^1.0",
"symfony/console": "7.1.*",
"symfony/dotenv": "7.1.*",
"symfony/flex": "^2",
@ -25,7 +26,7 @@
},
"require-dev": {
"lubiana/code-quality": "^1.7",
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^9.6.19",
"symfony/browser-kit": "7.1.*",
"symfony/css-selector": "7.1.*",
"symfony/maker-bundle": "^1.60",

352
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "ab475528135d157af8dae9e8b967be1a",
"content-hash": "2196ad236d40a68b165bf39ce4543bfc",
"packages": [
{
"name": "doctrine/cache",
@ -883,21 +883,21 @@
},
{
"name": "doctrine/migrations",
"version": "3.7.4",
"version": "3.8.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/migrations.git",
"reference": "954e0a314c2f0eb9fb418210445111747de254a6"
"reference": "535a70dcbd88b8c6ba945be050977457f4f4c06c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/migrations/zipball/954e0a314c2f0eb9fb418210445111747de254a6",
"reference": "954e0a314c2f0eb9fb418210445111747de254a6",
"url": "https://api.github.com/repos/doctrine/migrations/zipball/535a70dcbd88b8c6ba945be050977457f4f4c06c",
"reference": "535a70dcbd88b8c6ba945be050977457f4f4c06c",
"shasum": ""
},
"require": {
"composer-runtime-api": "^2",
"doctrine/dbal": "^3.5.1 || ^4",
"doctrine/dbal": "^3.6 || ^4",
"doctrine/deprecations": "^0.5.3 || ^1",
"doctrine/event-manager": "^1.2 || ^2.0",
"php": "^8.1",
@ -935,7 +935,7 @@
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Migrations\\": "lib/Doctrine/Migrations"
"Doctrine\\Migrations\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
@ -965,7 +965,7 @@
],
"support": {
"issues": "https://github.com/doctrine/migrations/issues",
"source": "https://github.com/doctrine/migrations/tree/3.7.4"
"source": "https://github.com/doctrine/migrations/tree/3.8.0"
},
"funding": [
{
@ -981,20 +981,20 @@
"type": "tidelift"
}
],
"time": "2024-03-06T13:41:11+00:00"
"time": "2024-06-26T14:12:46+00:00"
},
{
"name": "doctrine/orm",
"version": "3.2.0",
"version": "3.2.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/orm.git",
"reference": "37946d3a21ddf837c0d84f8156ee60a92102e332"
"reference": "722cea6536775206e81744542b36fa7c9a4ea3e5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/orm/zipball/37946d3a21ddf837c0d84f8156ee60a92102e332",
"reference": "37946d3a21ddf837c0d84f8156ee60a92102e332",
"url": "https://api.github.com/repos/doctrine/orm/zipball/722cea6536775206e81744542b36fa7c9a4ea3e5",
"reference": "722cea6536775206e81744542b36fa7c9a4ea3e5",
"shasum": ""
},
"require": {
@ -1067,9 +1067,9 @@
],
"support": {
"issues": "https://github.com/doctrine/orm/issues",
"source": "https://github.com/doctrine/orm/tree/3.2.0"
"source": "https://github.com/doctrine/orm/tree/3.2.1"
},
"time": "2024-05-23T14:27:52+00:00"
"time": "2024-06-26T21:48:58+00:00"
},
{
"name": "doctrine/persistence",
@ -1272,6 +1272,54 @@
},
"time": "2021-02-03T23:26:27+00:00"
},
{
"name": "psr/clock",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/clock.git",
"reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d",
"reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d",
"shasum": ""
},
"require": {
"php": "^7.0 || ^8.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Psr\\Clock\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for reading the clock.",
"homepage": "https://github.com/php-fig/clock",
"keywords": [
"clock",
"now",
"psr",
"psr-20",
"time"
],
"support": {
"issues": "https://github.com/php-fig/clock/issues",
"source": "https://github.com/php-fig/clock/tree/1.0.0"
},
"time": "2022-11-25T14:36:26+00:00"
},
{
"name": "psr/container",
"version": "2.0.2",
@ -1427,16 +1475,16 @@
},
{
"name": "symfony/cache",
"version": "v7.1.1",
"version": "v7.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/cache.git",
"reference": "760294dc7158372699dccd077965c16c328f8719"
"reference": "e933e1d947ffb88efcdd34a2bd51561cab7deaae"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/cache/zipball/760294dc7158372699dccd077965c16c328f8719",
"reference": "760294dc7158372699dccd077965c16c328f8719",
"url": "https://api.github.com/repos/symfony/cache/zipball/e933e1d947ffb88efcdd34a2bd51561cab7deaae",
"reference": "e933e1d947ffb88efcdd34a2bd51561cab7deaae",
"shasum": ""
},
"require": {
@ -1504,7 +1552,7 @@
"psr6"
],
"support": {
"source": "https://github.com/symfony/cache/tree/v7.1.1"
"source": "https://github.com/symfony/cache/tree/v7.1.2"
},
"funding": [
{
@ -1520,7 +1568,7 @@
"type": "tidelift"
}
],
"time": "2024-05-31T14:57:53+00:00"
"time": "2024-06-11T13:32:38+00:00"
},
{
"name": "symfony/cache-contracts",
@ -1675,16 +1723,16 @@
},
{
"name": "symfony/console",
"version": "v7.1.1",
"version": "v7.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "9b008f2d7b21c74ef4d0c3de6077a642bc55ece3"
"reference": "0aa29ca177f432ab68533432db0de059f39c92ae"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/9b008f2d7b21c74ef4d0c3de6077a642bc55ece3",
"reference": "9b008f2d7b21c74ef4d0c3de6077a642bc55ece3",
"url": "https://api.github.com/repos/symfony/console/zipball/0aa29ca177f432ab68533432db0de059f39c92ae",
"reference": "0aa29ca177f432ab68533432db0de059f39c92ae",
"shasum": ""
},
"require": {
@ -1748,7 +1796,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v7.1.1"
"source": "https://github.com/symfony/console/tree/v7.1.2"
},
"funding": [
{
@ -1764,20 +1812,20 @@
"type": "tidelift"
}
],
"time": "2024-05-31T14:57:53+00:00"
"time": "2024-06-28T10:03:55+00:00"
},
{
"name": "symfony/dependency-injection",
"version": "v7.1.1",
"version": "v7.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
"reference": "77c636dfd86c0b60c5d184b2fd2ddf8dd11c309c"
"reference": "6e108cded928bdafaf1da3fabe30dd5af20e36b9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/77c636dfd86c0b60c5d184b2fd2ddf8dd11c309c",
"reference": "77c636dfd86c0b60c5d184b2fd2ddf8dd11c309c",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/6e108cded928bdafaf1da3fabe30dd5af20e36b9",
"reference": "6e108cded928bdafaf1da3fabe30dd5af20e36b9",
"shasum": ""
},
"require": {
@ -1828,7 +1876,7 @@
"description": "Allows you to standardize and centralize the way objects are constructed in your application",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/dependency-injection/tree/v7.1.1"
"source": "https://github.com/symfony/dependency-injection/tree/v7.1.2"
},
"funding": [
{
@ -1844,7 +1892,7 @@
"type": "tidelift"
}
],
"time": "2024-05-31T14:57:53+00:00"
"time": "2024-06-28T10:03:55+00:00"
},
{
"name": "symfony/deprecation-contracts",
@ -1915,16 +1963,16 @@
},
{
"name": "symfony/doctrine-bridge",
"version": "v7.1.1",
"version": "v7.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/doctrine-bridge.git",
"reference": "2c36eca96f111ada35b648a4d6e8aa61f354e4d4"
"reference": "9fc4bebf69f00d4ebb12ee904d808b496035e2f6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/2c36eca96f111ada35b648a4d6e8aa61f354e4d4",
"reference": "2c36eca96f111ada35b648a4d6e8aa61f354e4d4",
"url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/9fc4bebf69f00d4ebb12ee904d808b496035e2f6",
"reference": "9fc4bebf69f00d4ebb12ee904d808b496035e2f6",
"shasum": ""
},
"require": {
@ -2003,7 +2051,7 @@
"description": "Provides integration for Doctrine with various Symfony components",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/doctrine-bridge/tree/v7.1.1"
"source": "https://github.com/symfony/doctrine-bridge/tree/v7.1.2"
},
"funding": [
{
@ -2019,7 +2067,7 @@
"type": "tidelift"
}
],
"time": "2024-05-31T14:57:53+00:00"
"time": "2024-06-28T09:27:18+00:00"
},
{
"name": "symfony/dotenv",
@ -2097,16 +2145,16 @@
},
{
"name": "symfony/error-handler",
"version": "v7.1.1",
"version": "v7.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/error-handler.git",
"reference": "e9b8bbce0b4f322939332ab7b6b81d8c11da27dd"
"reference": "2412d3dddb5c9ea51a39cfbff1c565fc9844ca32"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/error-handler/zipball/e9b8bbce0b4f322939332ab7b6b81d8c11da27dd",
"reference": "e9b8bbce0b4f322939332ab7b6b81d8c11da27dd",
"url": "https://api.github.com/repos/symfony/error-handler/zipball/2412d3dddb5c9ea51a39cfbff1c565fc9844ca32",
"reference": "2412d3dddb5c9ea51a39cfbff1c565fc9844ca32",
"shasum": ""
},
"require": {
@ -2152,7 +2200,7 @@
"description": "Provides tools to manage errors and ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/error-handler/tree/v7.1.1"
"source": "https://github.com/symfony/error-handler/tree/v7.1.2"
},
"funding": [
{
@ -2168,7 +2216,7 @@
"type": "tidelift"
}
],
"time": "2024-05-31T14:57:53+00:00"
"time": "2024-06-25T19:55:06+00:00"
},
{
"name": "symfony/event-dispatcher",
@ -2328,16 +2376,16 @@
},
{
"name": "symfony/filesystem",
"version": "v7.1.1",
"version": "v7.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
"reference": "802e87002f919296c9f606457d9fa327a0b3d6b2"
"reference": "92a91985250c251de9b947a14bb2c9390b1a562c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/802e87002f919296c9f606457d9fa327a0b3d6b2",
"reference": "802e87002f919296c9f606457d9fa327a0b3d6b2",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/92a91985250c251de9b947a14bb2c9390b1a562c",
"reference": "92a91985250c251de9b947a14bb2c9390b1a562c",
"shasum": ""
},
"require": {
@ -2374,7 +2422,7 @@
"description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/filesystem/tree/v7.1.1"
"source": "https://github.com/symfony/filesystem/tree/v7.1.2"
},
"funding": [
{
@ -2390,7 +2438,7 @@
"type": "tidelift"
}
],
"time": "2024-05-31T14:57:53+00:00"
"time": "2024-06-28T10:03:55+00:00"
},
{
"name": "symfony/finder",
@ -2620,16 +2668,16 @@
},
{
"name": "symfony/framework-bundle",
"version": "v7.1.1",
"version": "v7.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/framework-bundle.git",
"reference": "79a20497022b8853416e20c836ee150b754c332a"
"reference": "54a84f49658e2e87167396b2259a55e55e11f4a2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/framework-bundle/zipball/79a20497022b8853416e20c836ee150b754c332a",
"reference": "79a20497022b8853416e20c836ee150b754c332a",
"url": "https://api.github.com/repos/symfony/framework-bundle/zipball/54a84f49658e2e87167396b2259a55e55e11f4a2",
"reference": "54a84f49658e2e87167396b2259a55e55e11f4a2",
"shasum": ""
},
"require": {
@ -2747,7 +2795,7 @@
"description": "Provides a tight integration between Symfony components and the Symfony full-stack framework",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/framework-bundle/tree/v7.1.1"
"source": "https://github.com/symfony/framework-bundle/tree/v7.1.2"
},
"funding": [
{
@ -2763,7 +2811,7 @@
"type": "tidelift"
}
],
"time": "2024-06-04T06:40:14+00:00"
"time": "2024-06-28T08:00:31+00:00"
},
{
"name": "symfony/http-foundation",
@ -2844,16 +2892,16 @@
},
{
"name": "symfony/http-kernel",
"version": "v7.1.1",
"version": "v7.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "fa8d1c75b5f33b1302afccf81811f93976c6e26f"
"reference": "ae3fa717db4d41a55d14c2bd92399e37cf5bc0f6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/fa8d1c75b5f33b1302afccf81811f93976c6e26f",
"reference": "fa8d1c75b5f33b1302afccf81811f93976c6e26f",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/ae3fa717db4d41a55d14c2bd92399e37cf5bc0f6",
"reference": "ae3fa717db4d41a55d14c2bd92399e37cf5bc0f6",
"shasum": ""
},
"require": {
@ -2938,7 +2986,7 @@
"description": "Provides a structured process for converting a Request into a Response",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-kernel/tree/v7.1.1"
"source": "https://github.com/symfony/http-kernel/tree/v7.1.2"
},
"funding": [
{
@ -2954,7 +3002,7 @@
"type": "tidelift"
}
],
"time": "2024-06-04T06:52:15+00:00"
"time": "2024-06-28T13:13:31+00:00"
},
{
"name": "symfony/options-resolver",
@ -3651,16 +3699,16 @@
},
{
"name": "symfony/property-info",
"version": "v7.1.1",
"version": "v7.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/property-info.git",
"reference": "0f80f818c6728f15de30a4f89866d68e4912ae84"
"reference": "d7b91e4aa07e822a9b935fc29a7254c12d502f16"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/property-info/zipball/0f80f818c6728f15de30a4f89866d68e4912ae84",
"reference": "0f80f818c6728f15de30a4f89866d68e4912ae84",
"url": "https://api.github.com/repos/symfony/property-info/zipball/d7b91e4aa07e822a9b935fc29a7254c12d502f16",
"reference": "d7b91e4aa07e822a9b935fc29a7254c12d502f16",
"shasum": ""
},
"require": {
@ -3715,7 +3763,7 @@
"validator"
],
"support": {
"source": "https://github.com/symfony/property-info/tree/v7.1.1"
"source": "https://github.com/symfony/property-info/tree/v7.1.2"
},
"funding": [
{
@ -3731,7 +3779,7 @@
"type": "tidelift"
}
],
"time": "2024-05-31T14:57:53+00:00"
"time": "2024-06-26T07:21:35+00:00"
},
{
"name": "symfony/routing",
@ -3895,16 +3943,16 @@
},
{
"name": "symfony/security-core",
"version": "v7.1.1",
"version": "v7.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/security-core.git",
"reference": "536399671a46b0e615d69583f067e30ad25ad038"
"reference": "d615960211a11913e70f8576e5c38cd05d90ec3f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/security-core/zipball/536399671a46b0e615d69583f067e30ad25ad038",
"reference": "536399671a46b0e615d69583f067e30ad25ad038",
"url": "https://api.github.com/repos/symfony/security-core/zipball/d615960211a11913e70f8576e5c38cd05d90ec3f",
"reference": "d615960211a11913e70f8576e5c38cd05d90ec3f",
"shasum": ""
},
"require": {
@ -3961,7 +4009,7 @@
"description": "Symfony Security Component - Core Library",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/security-core/tree/v7.1.1"
"source": "https://github.com/symfony/security-core/tree/v7.1.2"
},
"funding": [
{
@ -3977,7 +4025,7 @@
"type": "tidelift"
}
],
"time": "2024-05-31T14:57:53+00:00"
"time": "2024-06-28T08:00:31+00:00"
},
{
"name": "symfony/security-csrf",
@ -4194,16 +4242,16 @@
},
{
"name": "symfony/string",
"version": "v7.1.1",
"version": "v7.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
"reference": "60bc311c74e0af215101235aa6f471bcbc032df2"
"reference": "14221089ac66cf82e3cf3d1c1da65de305587ff8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/60bc311c74e0af215101235aa6f471bcbc032df2",
"reference": "60bc311c74e0af215101235aa6f471bcbc032df2",
"url": "https://api.github.com/repos/symfony/string/zipball/14221089ac66cf82e3cf3d1c1da65de305587ff8",
"reference": "14221089ac66cf82e3cf3d1c1da65de305587ff8",
"shasum": ""
},
"require": {
@ -4261,7 +4309,7 @@
"utf8"
],
"support": {
"source": "https://github.com/symfony/string/tree/v7.1.1"
"source": "https://github.com/symfony/string/tree/v7.1.2"
},
"funding": [
{
@ -4277,7 +4325,7 @@
"type": "tidelift"
}
],
"time": "2024-06-04T06:40:14+00:00"
"time": "2024-06-28T09:27:18+00:00"
},
{
"name": "symfony/translation-contracts",
@ -4708,16 +4756,16 @@
},
{
"name": "symfony/validator",
"version": "v7.1.1",
"version": "v7.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/validator.git",
"reference": "fcab7598968b21c361becc930fcae8846638c4c0"
"reference": "bed12b7d5bd4dac452db5fa6203331c876b489e7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/validator/zipball/fcab7598968b21c361becc930fcae8846638c4c0",
"reference": "fcab7598968b21c361becc930fcae8846638c4c0",
"url": "https://api.github.com/repos/symfony/validator/zipball/bed12b7d5bd4dac452db5fa6203331c876b489e7",
"reference": "bed12b7d5bd4dac452db5fa6203331c876b489e7",
"shasum": ""
},
"require": {
@ -4785,7 +4833,7 @@
"description": "Provides tools to validate values",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/validator/tree/v7.1.1"
"source": "https://github.com/symfony/validator/tree/v7.1.2"
},
"funding": [
{
@ -4801,20 +4849,20 @@
"type": "tidelift"
}
],
"time": "2024-06-04T05:58:56+00:00"
"time": "2024-06-25T19:55:06+00:00"
},
{
"name": "symfony/var-dumper",
"version": "v7.1.1",
"version": "v7.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "deb2c2b506ff6fdbb340e00b34e9901e1605f293"
"reference": "5857c57c6b4b86524c08cf4f4bc95327270a816d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/deb2c2b506ff6fdbb340e00b34e9901e1605f293",
"reference": "deb2c2b506ff6fdbb340e00b34e9901e1605f293",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/5857c57c6b4b86524c08cf4f4bc95327270a816d",
"reference": "5857c57c6b4b86524c08cf4f4bc95327270a816d",
"shasum": ""
},
"require": {
@ -4868,7 +4916,7 @@
"dump"
],
"support": {
"source": "https://github.com/symfony/var-dumper/tree/v7.1.1"
"source": "https://github.com/symfony/var-dumper/tree/v7.1.2"
},
"funding": [
{
@ -4884,20 +4932,20 @@
"type": "tidelift"
}
],
"time": "2024-05-31T14:57:53+00:00"
"time": "2024-06-28T08:00:31+00:00"
},
{
"name": "symfony/var-exporter",
"version": "v7.1.1",
"version": "v7.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-exporter.git",
"reference": "db82c2b73b88734557cfc30e3270d83fa651b712"
"reference": "b80a669a2264609f07f1667f891dbfca25eba44c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-exporter/zipball/db82c2b73b88734557cfc30e3270d83fa651b712",
"reference": "db82c2b73b88734557cfc30e3270d83fa651b712",
"url": "https://api.github.com/repos/symfony/var-exporter/zipball/b80a669a2264609f07f1667f891dbfca25eba44c",
"reference": "b80a669a2264609f07f1667f891dbfca25eba44c",
"shasum": ""
},
"require": {
@ -4944,7 +4992,7 @@
"serialize"
],
"support": {
"source": "https://github.com/symfony/var-exporter/tree/v7.1.1"
"source": "https://github.com/symfony/var-exporter/tree/v7.1.2"
},
"funding": [
{
@ -4960,7 +5008,7 @@
"type": "tidelift"
}
],
"time": "2024-05-31T14:57:53+00:00"
"time": "2024-06-28T08:00:31+00:00"
},
{
"name": "symfony/yaml",
@ -5350,16 +5398,16 @@
},
{
"name": "nikic/php-parser",
"version": "v5.0.2",
"version": "v5.1.0",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13"
"reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13",
"reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/683130c2ff8c2739f4822ff7ac5c873ec529abd1",
"reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1",
"shasum": ""
},
"require": {
@ -5370,7 +5418,7 @@
},
"require-dev": {
"ircmaxell/php-yacc": "^0.0.7",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0"
"phpunit/phpunit": "^9.0"
},
"bin": [
"bin/php-parse"
@ -5402,9 +5450,9 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
"source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2"
"source": "https://github.com/nikic/PHP-Parser/tree/v5.1.0"
},
"time": "2024-03-05T20:51:40+00:00"
"time": "2024-07-01T20:03:41+00:00"
},
{
"name": "phar-io/manifest",
@ -5573,16 +5621,16 @@
},
{
"name": "phpstan/phpstan",
"version": "1.11.5",
"version": "1.11.7",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "490f0ae1c92b082f154681d7849aee776a7c1443"
"reference": "52d2bbfdcae7f895915629e4694e9497d0f8e28d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/490f0ae1c92b082f154681d7849aee776a7c1443",
"reference": "490f0ae1c92b082f154681d7849aee776a7c1443",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/52d2bbfdcae7f895915629e4694e9497d0f8e28d",
"reference": "52d2bbfdcae7f895915629e4694e9497d0f8e28d",
"shasum": ""
},
"require": {
@ -5627,7 +5675,7 @@
"type": "github"
}
],
"time": "2024-06-17T15:10:54+00:00"
"time": "2024-07-06T11:17:41+00:00"
},
{
"name": "phpunit/php-code-coverage",
@ -5950,45 +5998,45 @@
},
{
"name": "phpunit/phpunit",
"version": "9.6.19",
"version": "9.6.20",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "a1a54a473501ef4cdeaae4e06891674114d79db8"
"reference": "49d7820565836236411f5dc002d16dd689cde42f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1a54a473501ef4cdeaae4e06891674114d79db8",
"reference": "a1a54a473501ef4cdeaae4e06891674114d79db8",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/49d7820565836236411f5dc002d16dd689cde42f",
"reference": "49d7820565836236411f5dc002d16dd689cde42f",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.3.1 || ^2",
"doctrine/instantiator": "^1.5.0 || ^2",
"ext-dom": "*",
"ext-json": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-xml": "*",
"ext-xmlwriter": "*",
"myclabs/deep-copy": "^1.10.1",
"phar-io/manifest": "^2.0.3",
"phar-io/version": "^3.0.2",
"myclabs/deep-copy": "^1.12.0",
"phar-io/manifest": "^2.0.4",
"phar-io/version": "^3.2.1",
"php": ">=7.3",
"phpunit/php-code-coverage": "^9.2.28",
"phpunit/php-file-iterator": "^3.0.5",
"phpunit/php-code-coverage": "^9.2.31",
"phpunit/php-file-iterator": "^3.0.6",
"phpunit/php-invoker": "^3.1.1",
"phpunit/php-text-template": "^2.0.3",
"phpunit/php-timer": "^5.0.2",
"sebastian/cli-parser": "^1.0.1",
"sebastian/code-unit": "^1.0.6",
"phpunit/php-text-template": "^2.0.4",
"phpunit/php-timer": "^5.0.3",
"sebastian/cli-parser": "^1.0.2",
"sebastian/code-unit": "^1.0.8",
"sebastian/comparator": "^4.0.8",
"sebastian/diff": "^4.0.3",
"sebastian/environment": "^5.1.3",
"sebastian/exporter": "^4.0.5",
"sebastian/global-state": "^5.0.1",
"sebastian/object-enumerator": "^4.0.3",
"sebastian/resource-operations": "^3.0.3",
"sebastian/type": "^3.2",
"sebastian/diff": "^4.0.6",
"sebastian/environment": "^5.1.5",
"sebastian/exporter": "^4.0.6",
"sebastian/global-state": "^5.0.7",
"sebastian/object-enumerator": "^4.0.4",
"sebastian/resource-operations": "^3.0.4",
"sebastian/type": "^3.2.1",
"sebastian/version": "^3.0.2"
},
"suggest": {
@ -6033,7 +6081,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.19"
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.20"
},
"funding": [
{
@ -6049,20 +6097,20 @@
"type": "tidelift"
}
],
"time": "2024-04-05T04:35:58+00:00"
"time": "2024-07-10T11:45:39+00:00"
},
{
"name": "rector/rector",
"version": "1.1.1",
"version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/rectorphp/rector.git",
"reference": "c930cdb21294f10955ddfc31b720971e8333943d"
"reference": "2fa387553db22b6f9bcccf5ff16f2c2c18a52a65"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/c930cdb21294f10955ddfc31b720971e8333943d",
"reference": "c930cdb21294f10955ddfc31b720971e8333943d",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/2fa387553db22b6f9bcccf5ff16f2c2c18a52a65",
"reference": "2fa387553db22b6f9bcccf5ff16f2c2c18a52a65",
"shasum": ""
},
"require": {
@ -6100,7 +6148,7 @@
],
"support": {
"issues": "https://github.com/rectorphp/rector/issues",
"source": "https://github.com/rectorphp/rector/tree/1.1.1"
"source": "https://github.com/rectorphp/rector/tree/1.2.0"
},
"funding": [
{
@ -6108,7 +6156,7 @@
"type": "github"
}
],
"time": "2024-06-21T07:51:17+00:00"
"time": "2024-07-01T14:24:45+00:00"
},
{
"name": "sebastian/cli-parser",
@ -7512,16 +7560,16 @@
},
{
"name": "symfony/phpunit-bridge",
"version": "v7.1.1",
"version": "v7.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/phpunit-bridge.git",
"reference": "3e1cb8c4dee341cfe96ae9fe29b1acda52a6bb16"
"reference": "8eb63f1c0e2001f97b3cd9ed550b18765cdeb1c8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/3e1cb8c4dee341cfe96ae9fe29b1acda52a6bb16",
"reference": "3e1cb8c4dee341cfe96ae9fe29b1acda52a6bb16",
"url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/8eb63f1c0e2001f97b3cd9ed550b18765cdeb1c8",
"reference": "8eb63f1c0e2001f97b3cd9ed550b18765cdeb1c8",
"shasum": ""
},
"require": {
@ -7574,7 +7622,7 @@
"description": "Provides utilities for PHPUnit, especially user deprecation notices management",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/phpunit-bridge/tree/v7.1.1"
"source": "https://github.com/symfony/phpunit-bridge/tree/v7.1.2"
},
"funding": [
{
@ -7590,7 +7638,7 @@
"type": "tidelift"
}
],
"time": "2024-06-04T06:50:37+00:00"
"time": "2024-06-25T19:55:06+00:00"
},
{
"name": "symfony/process",
@ -7697,16 +7745,16 @@
},
{
"name": "symplify/easy-coding-standard",
"version": "12.3.0",
"version": "12.3.1",
"source": {
"type": "git",
"url": "https://github.com/easy-coding-standard/easy-coding-standard.git",
"reference": "f919574aa566b4d00fd06700ca61168aafef66e1"
"reference": "bd670feae8d0b6da891d29a3c549bd0f4aa48711"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/easy-coding-standard/easy-coding-standard/zipball/f919574aa566b4d00fd06700ca61168aafef66e1",
"reference": "f919574aa566b4d00fd06700ca61168aafef66e1",
"url": "https://api.github.com/repos/easy-coding-standard/easy-coding-standard/zipball/bd670feae8d0b6da891d29a3c549bd0f4aa48711",
"reference": "bd670feae8d0b6da891d29a3c549bd0f4aa48711",
"shasum": ""
},
"require": {
@ -7742,7 +7790,7 @@
],
"support": {
"issues": "https://github.com/easy-coding-standard/easy-coding-standard/issues",
"source": "https://github.com/easy-coding-standard/easy-coding-standard/tree/12.3.0"
"source": "https://github.com/easy-coding-standard/easy-coding-standard/tree/12.3.1"
},
"funding": [
{
@ -7754,7 +7802,7 @@
"type": "github"
}
],
"time": "2024-06-18T07:35:59+00:00"
"time": "2024-07-06T12:33:15+00:00"
},
{
"name": "theseer/tokenizer",

View file

@ -15,28 +15,45 @@ use Symfony\Component\Routing\Attribute\Route;
final class FoodOrderController extends AbstractController
{
#[Route(
path: '/list/{page}',
path: '/list',
name: 'app_food_order_index',
methods: ['GET']
)]
public function index(FoodOrderRepository $foodOrderRepository): Response
{
return $this->render('food_order/index.html.twig', [
'food_orders' => $foodOrderRepository->findLatestEntries(days: 3),
'current_page' => 0,
'next_page' => 0,
'prev_page' => 0,
]);
}
#[Route(
path: '/list/archive/{page}',
name: 'app_food_order_archive',
requirements: [
'page' => '\d+',
],
methods: ['GET']
)]
public function index(FoodOrderRepository $foodOrderRepository, int $page = 1): Response
public function archive(FoodOrderRepository $foodOrderRepository, int $page = 1): Response
{
$days = 4;
if ($page > 1) {
$days = 0;
}
$nextPage = $page + 1;
$prevPage = $page - 1;
$itemsPerPage = 10;
if($foodOrderRepository->count() < $page * $itemsPerPage) {
$count = $foodOrderRepository->count();
if($count < $page * $itemsPerPage) {
$nextPage = $page;
}
return $this->render('food_order/index.html.twig', [
'food_orders' => $foodOrderRepository->findLatestEntries(page: $page, pagesize: $itemsPerPage, days: $days),
'food_orders' => $foodOrderRepository->findLatestEntries(
page: $page,
pagesize: $itemsPerPage,
days: 0
),
'current_page' => $page,
'next_page' => $nextPage,
'prev_page' => $prevPage,

View file

@ -8,19 +8,12 @@ use DateTimeImmutable;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\IdGenerator\UlidGenerator;
use Symfony\Bridge\Doctrine\Types\UlidType;
use Symfony\Component\Uid\Ulid;
#[ORM\Entity(repositoryClass: FoodOrderRepository::class)]
class FoodOrder
{
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\Column(type: UlidType::NAME, unique: true)]
#[ORM\CustomIdGenerator(class: UlidGenerator::class)]
private Ulid|null $id = null;
#[ORM\Column(nullable: true)]
private DateTimeImmutable|null $closedAt = null;
@ -39,8 +32,11 @@ class FoodOrder
])]
private string|null $createdBy = 'nobody';
public function __construct()
{
public function __construct(
#[ORM\Id]
#[ORM\Column(type: UlidType::NAME, unique: true)]
private Ulid|null $id = new Ulid
) {
$this->orderItems = new ArrayCollection;
$this->open();
}

View file

@ -25,17 +25,21 @@
<tbody>
{% for food_order in food_orders %}
{{ include('food_order/table_row.html.twig') }}
{% else %}
<tr>
<td colspan="4">no records found</td>
</tr>
{% endfor %}
{% if food_orders|length < 10 %}
<tr>
<td colspan="5">
check the <a href="{{ path('app_food_order_archive') }}">archive</a>
for older orders
</td>
</tr>
{% endif %}
</tbody>
</table>
{% if prev_page > 0 %}
<a href="{{ path('app_food_order_index', {'page': prev_page}) }}">previous page</a> |
<a href="{{ path('app_food_order_archive', {'page': prev_page}) }}">previous page</a> |
{% endif %}
{% if next_page > current_page %}
<a href="{{ path('app_food_order_index', {'page': next_page}) }}">next page</a>
<a href="{{ path('app_food_order_archive', {'page': next_page}) }}">next page</a>
{% endif %}
{% endblock %}

View file

@ -8,6 +8,7 @@ use App\Tests\DbWebTest;
use Override;
use Symfony\Component\DomCrawler\Crawler;
use function range;
use function sprintf;
final class FoodOrderControllerTest extends DbWebTest
@ -51,6 +52,58 @@ final class FoodOrderControllerTest extends DbWebTest
);
}
public function testPaginatedIndex(): void
{
$this->generatePaginatedOrders();
$crawler = $this->client->request('GET', "{$this->path}list");
self::assertResponseStatusCodeSame(200);
self::assertPageTitleContains('FoodOrder index');
$this->assertElementContainsCount(
$crawler,
'td',
1,
'older orders'
);
$this->assertElementContainsCount(
$crawler,
'td',
0,
'next page'
);
}
/**
* @testWith [1, 0, 1]
* [2, 1, 1]
* [3, 1, 1]
* [4, 1, 0, 5]
*/
public function testPaginatedFirstPage(int $page, int $prevPage, int $nextPage, int $items = 10): void
{
$this->generatePaginatedOrders();
$crawler = $this->client->request('GET', "{$this->path}list/archive/{$page}");
self::assertResponseStatusCodeSame(200);
self::assertPageTitleContains('FoodOrder index');
$this->assertElementContainsCount(
$crawler,
'td',
$items,
'nobody'
);
$this->assertElementContainsCount(
$crawler,
'a',
$nextPage,
'next page'
);
$this->assertElementContainsCount(
$crawler,
'a',
$prevPage,
'previous page'
);
}
public function testNew(): void
{
$this->client->request('GET', sprintf('%snew', $this->path));
@ -64,4 +117,16 @@ final class FoodOrderControllerTest extends DbWebTest
self::assertResponseRedirects("{$this->path}list");
self::assertSame(1, $this->repository->count([]));
}
private function generatePaginatedOrders(): void
{
foreach (range(1, 35) as $i) {
$order = new FoodOrder($this->generateOldUlid());
$order->setFoodVendor($this->vendor);
$order->close();
$this->manager->persist($order);
}
$this->manager->flush();
}
}

View file

@ -0,0 +1,61 @@
<?php declare(strict_types=1);
namespace App\Tests\Controller;
use App\Tests\DbWebTest;
use Override;
final class HomeControllerTest extends DbWebTest
{
public function testIndex(): void
{
$this->client->request(
'GET',
'/'
);
self::assertResponseStatusCodeSame(302);
self::assertResponseHeaderSame('Location', '/food/order/list');
}
public function testSetUsername(): void
{
$this->client->request(
'GET',
'/username',
);
self::assertResponseStatusCodeSame(200);
$this->client->submitForm('Save', [
'user_name_form[username]' => 'Testing-1',
]);
self::assertResponseStatusCodeSame(302);
self::assertResponseHeaderSame('Location', '/food/order/list');
self::assertResponseCookieValueSame('username', 'Testing-1');
}
public function testRemoveUsername(): void
{
$this->client->request(
'GET',
'/username',
);
self::assertResponseStatusCodeSame(200);
$this->client->submitForm('Save', [
'user_name_form[username]' => '',
]);
self::assertResponseStatusCodeSame(302);
self::assertResponseHeaderSame('Location', '/food/order/list');
self::assertResponseCookieValueSame('username', '');
}
#[Override]
public function getEntityClass(): string
{
return '';
}
}

View file

@ -2,12 +2,18 @@
namespace App\Tests;
use DateInterval;
use DateTimeImmutable;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Tools\SchemaTool;
use Override;
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DomCrawler\Crawler;
use Symfony\Component\Uid\Ulid;
use function str_contains;
abstract class DbWebTest extends WebTestCase
{
@ -28,6 +34,26 @@ abstract class DbWebTest extends WebTestCase
$schemaTool->dropDatabase();
$schemaTool->updateSchema($metadata);
$this->repository = $this->manager->getRepository($this->getEntityClass());
if ($this->getEntityClass() !== '') {
$this->repository = $this->manager->getRepository($this->getEntityClass());
}
}
protected function generateOldUlid(int $daysToSubtract = 10): Ulid
{
$date = (new DateTimeImmutable)->sub(new DateInterval('P' . $daysToSubtract . 'D'));
$ulidString = Ulid::generate($date);
return Ulid::fromString($ulidString);
}
protected function assertElementContainsCount(Crawler $crawler, string $element, int $count, string $text): void
{
$this->assertCount(
$count,
$crawler->filter($element)
->reduce(
static fn(Crawler $node, $i): bool => str_contains($node->text(), $text),
)
);
}
}