File tree Expand file tree Collapse file tree 5 files changed +104
-0
lines changed Expand file tree Collapse file tree 5 files changed +104
-0
lines changed Original file line number Diff line number Diff line change @@ -25,3 +25,7 @@ composer.lock
25
25
/public /assets /
26
26
/assets /vendor /
27
27
# ##< symfony/asset-mapper ###
28
+
29
+ # ##> phpunit/phpunit ###
30
+ /.phpunit.cache /
31
+ # ##< phpunit/phpunit ###
Original file line number Diff line number Diff line change 51
51
"twig/twig" : " ^3.0"
52
52
},
53
53
"require-dev" : {
54
+ "phpunit/phpunit" : " *" ,
54
55
"symfony/browser-kit" : " *" ,
55
56
"symfony/css-selector" : " *" ,
56
57
"symfony/debug-bundle" : " *" ,
Original file line number Diff line number Diff line change
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 >
Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change 104
104
"phpdocumentor/type-resolver": {
105
105
"version": "1.5.1"
106
106
},
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
+ },
107
122
"psr/cache": {
108
123
"version": "3.0.0"
109
124
},
433
448
"config/routes.yaml"
434
449
]
435
450
},
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
+ },
436
463
"symfony/security-bundle": {
437
464
"version": "5.4",
438
465
"recipe": {
You can’t perform that action at this time.
0 commit comments