Compare commits

...
2 Commits
Author SHA1 Message Date
fromme dcd85bb911 fix: keep the calendar day tests independent of the current date 2026-10-01 10:16:56 +02:00
fromme 4b70d0e2b7 chore: bump project to php 8.5 2026-10-01 10:16:06 +02:00
4 changed files with 23 additions and 11 deletions

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
name: ephub
type: symfony
docroot: public
php_version: "8.4"
php_version: "8.5"
webserver_type: apache-fpm
xdebug_enabled: false
additional_hostnames: []
+5 -2
View File
@@ -4,7 +4,7 @@
"minimum-stability": "stable",
"prefer-stable": true,
"require": {
"php": ">=8.2",
"php": ">=8.5",
"ext-ctype": "*",
"ext-iconv": "*",
"doctrine/doctrine-bundle": "^3.3",
@@ -56,7 +56,10 @@
"symfony/runtime": true
},
"bump-after-update": true,
"sort-packages": true
"sort-packages": true,
"platform": {
"php": "8.5.0"
}
},
"autoload": {
"psr-4": {
Generated
+5 -2
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": "3654c7abbba926fa47fcade4936237f0",
"content-hash": "d4a87cae8b7e936e22ef401af274c700",
"packages": [
{
"name": "composer/semver",
@@ -11492,10 +11492,13 @@
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
"php": ">=8.2",
"php": ">=8.5",
"ext-ctype": "*",
"ext-iconv": "*"
},
"platform-dev": {},
"platform-overrides": {
"php": "8.5.0"
},
"plugin-api-version": "2.9.0"
}
+12 -6
View File
@@ -546,10 +546,13 @@ class BookingControllerTest extends WebTestCase
public function testPastDaysInTheCalendarAreMarkedButStillNavigable(): void
{
$this->client->loginUser($this->user('[email protected]'));
$yesterday = (new \DateTimeImmutable('today'))->modify('-1 day')->format('Y-m-d');
// Mid-month of last month rather than yesterday: on the 1st, yesterday is a spill-over
// day from the month before, and the out-of-month styling takes precedence over "past".
$selected = (new \DateTimeImmutable('first day of last month midnight'))->modify('+14 days');
$past = $selected->modify('-1 day')->format('Y-m-d');
$crawler = $this->client->request('GET', '/book/desk');
$cell = $crawler->filter(\sprintf('button[hx-get*="/book/desk/day/%s"]', $yesterday));
$crawler = $this->client->request('GET', '/book/desk?date='.$selected->format('Y-m-d'));
$cell = $crawler->filter(\sprintf('button[hx-get*="/book/desk/day/%s"]', $past));
self::assertCount(1, $cell);
self::assertSame('true', $cell->attr('aria-disabled'));
@@ -559,10 +562,13 @@ class BookingControllerTest extends WebTestCase
public function testFutureDaysInTheCalendarAreNotMarkedAsPast(): void
{
$this->client->loginUser($this->user('[email protected]'));
$tomorrow = (new \DateTimeImmutable('today'))->modify('+1 day')->format('Y-m-d');
// Mid-month of next month rather than tomorrow: on a month's last day, tomorrow falls
// outside the grid whenever that day is a Sunday.
$selected = (new \DateTimeImmutable('first day of next month midnight'))->modify('+14 days');
$future = $selected->modify('+1 day')->format('Y-m-d');
$crawler = $this->client->request('GET', '/book/desk');
$cell = $crawler->filter(\sprintf('button[hx-get*="/book/desk/day/%s"]', $tomorrow));
$crawler = $this->client->request('GET', '/book/desk?date='.$selected->format('Y-m-d'));
$cell = $crawler->filter(\sprintf('button[hx-get*="/book/desk/day/%s"]', $future));
self::assertCount(1, $cell);
self::assertNull($cell->attr('aria-disabled'));