Skip to content

Commit eed58fd

Browse files
Merge branch '7.3' into 7.4
* 7.3: Add phpunit/phpunit and updates recipes Bump php to 8.3 version (#38) Add `symfony/json-path` (#36)
2 parents 3795a3a + 0e11aae commit eed58fd

File tree

6 files changed

+109
-4
lines changed

6 files changed

+109
-4
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
build:
99
name: Test
10-
runs-on: Ubuntu-20.04
10+
runs-on: ubuntu-latest
1111

1212
steps:
1313
- name: Checkout code
@@ -16,11 +16,11 @@ jobs:
1616
- name: Set up PHP
1717
uses: shivammathur/setup-php@v2
1818
with:
19-
php-version: 8.2
19+
php-version: 8.3
2020
coverage: none
2121

2222
- name: Download dependencies
23-
uses: ramsey/composer-install@v2
23+
uses: ramsey/composer-install@v3
2424

2525
- name: Run tests
2626
run: ./bin/console cache:warmup --env dev

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ composer.lock
2525
/public/assets/
2626
/assets/vendor/
2727
###< symfony/asset-mapper ###
28+
29+
###> phpunit/phpunit ###
30+
/.phpunit.cache/
31+
###< phpunit/phpunit ###

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"type": "project",
33
"license": "proprietary",
44
"require": {
5-
"php": ">=8.1",
5+
"php": ">=8.3",
66
"ext-ctype": "*",
77
"ext-iconv": "*",
88
"composer/package-versions-deprecated": "1.11.99.1",
@@ -22,6 +22,7 @@
2222
"symfony/html-sanitizer": "*",
2323
"symfony/http-client": "*",
2424
"symfony/intl": "*",
25+
"symfony/json-path": "*",
2526
"symfony/json-streamer": "*",
2627
"symfony/lock": "*",
2728
"symfony/mailer": "*",
@@ -50,6 +51,7 @@
5051
"twig/twig": "^3.0"
5152
},
5253
"require-dev": {
54+
"phpunit/phpunit": "*",
5355
"symfony/browser-kit": "*",
5456
"symfony/css-selector": "*",
5557
"symfony/debug-bundle": "*",

phpunit.dist.xml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
4+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
6+
colors="true"
7+
failOnDeprecation="true"
8+
failOnNotice="true"
9+
failOnWarning="true"
10+
bootstrap="tests/bootstrap.php"
11+
cacheDirectory=".phpunit.cache"
12+
>
13+
<php>
14+
<ini name="display_errors" value="1" />
15+
<ini name="error_reporting" value="-1" />
16+
<server name="APP_ENV" value="test" force="true" />
17+
<server name="SHELL_VERBOSITY" value="-1" />
18+
</php>
19+
20+
<testsuites>
21+
<testsuite name="Project Test Suite">
22+
<directory>tests</directory>
23+
</testsuite>
24+
</testsuites>
25+
26+
<source ignoreSuppressionOfDeprecations="true"
27+
ignoreIndirectDeprecations="true"
28+
restrictNotices="true"
29+
restrictWarnings="true"
30+
>
31+
<include>
32+
<directory>src</directory>
33+
</include>
34+
35+
<deprecationTrigger>
36+
<method>Doctrine\Deprecations\Deprecation::trigger</method>
37+
<method>Doctrine\Deprecations\Deprecation::delegateTriggerToBackend</method>
38+
<function>trigger_deprecation</function>
39+
</deprecationTrigger>
40+
</source>
41+
42+
<extensions>
43+
</extensions>
44+
</phpunit>

src/Schedule.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use Symfony\Component\Scheduler\Attribute\AsSchedule;
6+
use Symfony\Component\Scheduler\Schedule as SymfonySchedule;
7+
use Symfony\Component\Scheduler\ScheduleProviderInterface;
8+
use Symfony\Contracts\Cache\CacheInterface;
9+
10+
#[AsSchedule]
11+
class Schedule implements ScheduleProviderInterface
12+
{
13+
public function __construct(
14+
private CacheInterface $cache,
15+
) {
16+
}
17+
18+
public function getSchedule(): SymfonySchedule
19+
{
20+
return (new SymfonySchedule())
21+
->stateful($this->cache) // ensure missed tasks are executed
22+
->processOnlyLastMissedRun(true) // ensure only last missed task is run
23+
24+
// add your own tasks here
25+
// see https://symfony.com/doc/current/scheduler.html#attaching-recurring-messages-to-a-schedule
26+
;
27+
}
28+
}

symfony.lock

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,21 @@
104104
"phpdocumentor/type-resolver": {
105105
"version": "1.5.1"
106106
},
107+
"phpunit/phpunit": {
108+
"version": "12.2",
109+
"recipe": {
110+
"repo": "github.com/symfony/recipes",
111+
"branch": "main",
112+
"version": "11.1",
113+
"ref": "c6658a60fc9d594805370eacdf542c3d6b5c0869"
114+
},
115+
"files": [
116+
".env.test",
117+
"phpunit.dist.xml",
118+
"tests/bootstrap.php",
119+
"bin/phpunit"
120+
]
121+
},
107122
"psr/cache": {
108123
"version": "3.0.0"
109124
},
@@ -433,6 +448,18 @@
433448
"config/routes.yaml"
434449
]
435450
},
451+
"symfony/scheduler": {
452+
"version": "7.3",
453+
"recipe": {
454+
"repo": "github.com/symfony/recipes",
455+
"branch": "main",
456+
"version": "7.2",
457+
"ref": "caea3c928ee9e1b21288fd76aef36f16ea355515"
458+
},
459+
"files": [
460+
"src/Schedule.php"
461+
]
462+
},
436463
"symfony/security-bundle": {
437464
"version": "5.4",
438465
"recipe": {

0 commit comments

Comments
 (0)