Skip to content

Commit 38b8c09

Browse files
Merge branch '7.1' into 7.2
* 7.1: fix: notifier push channel bus abstract arg [Scheduler] remove dead code
2 parents 38a0d1e + 571e659 commit 38b8c09

File tree

2 files changed

+23
-56
lines changed

2 files changed

+23
-56
lines changed

Tests/RecurringMessageTest.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Scheduler\Tests;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Random\Randomizer;
1615
use Symfony\Component\Scheduler\Exception\InvalidArgumentException;
1716
use Symfony\Component\Scheduler\RecurringMessage;
1817

@@ -22,13 +21,8 @@ public function testCanCreateHashedCronMessage()
2221
{
2322
$object = new DummyStringableMessage();
2423

25-
if (class_exists(Randomizer::class)) {
26-
$this->assertSame('30 0 * * *', (string) RecurringMessage::cron('#midnight', $object)->getTrigger());
27-
$this->assertSame('30 0 * * 3', (string) RecurringMessage::cron('#weekly', $object)->getTrigger());
28-
} else {
29-
$this->assertSame('36 0 * * *', (string) RecurringMessage::cron('#midnight', $object)->getTrigger());
30-
$this->assertSame('36 0 * * 6', (string) RecurringMessage::cron('#weekly', $object)->getTrigger());
31-
}
24+
$this->assertSame('30 0 * * *', (string) RecurringMessage::cron('#midnight', $object)->getTrigger());
25+
$this->assertSame('30 0 * * 3', (string) RecurringMessage::cron('#weekly', $object)->getTrigger());
3226
}
3327

3428
public function testHashedCronContextIsRequiredIfMessageIsNotStringable()

Tests/Trigger/CronExpressionTriggerTest.php

Lines changed: 21 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Scheduler\Tests\Trigger;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Random\Randomizer;
1615
use Symfony\Component\Scheduler\Trigger\CronExpressionTrigger;
1716

1817
class CronExpressionTriggerTest extends TestCase
@@ -33,54 +32,28 @@ public function testHashedExpressionParsing(string $input, string $expected)
3332

3433
public static function hashedExpressionProvider(): array
3534
{
36-
if (class_exists(Randomizer::class)) {
37-
return [
38-
['# * * * *', '30 * * * *'],
39-
['# # * * *', '30 0 * * *'],
40-
['# # # * *', '30 0 25 * *'],
41-
['# # # # *', '30 0 25 10 *'],
42-
['# # # # #', '30 0 25 10 5'],
43-
['# # 1,15 1-11 *', '30 0 1,15 1-11 *'],
44-
['# # 1,15 * *', '30 0 1,15 * *'],
45-
['#hourly', '30 * * * *'],
46-
['#daily', '30 0 * * *'],
47-
['#weekly', '30 0 * * 3'],
48-
['#weekly@midnight', '30 0 * * 3'],
49-
['#monthly', '30 0 25 * *'],
50-
['#monthly@midnight', '30 0 25 * *'],
51-
['#yearly', '30 0 25 10 *'],
52-
['#yearly@midnight', '30 0 25 10 *'],
53-
['#annually', '30 0 25 10 *'],
54-
['#annually@midnight', '30 0 25 10 *'],
55-
['#midnight', '30 0 * * *'],
56-
['#(1-15) * * * *', '1 * * * *'],
57-
['#(1-15) * * * #(3-5)', '1 * * * 3'],
58-
['#(1-15) * # * #(3-5)', '1 * 17 * 5'],
59-
];
60-
}
61-
6235
return [
63-
['# * * * *', '36 * * * *'],
64-
['# # * * *', '36 0 * * *'],
65-
['# # # * *', '36 0 14 * *'],
66-
['# # # # *', '36 0 14 3 *'],
67-
['# # # # #', '36 0 14 3 5'],
68-
['# # 1,15 1-11 *', '36 0 1,15 1-11 *'],
69-
['# # 1,15 * *', '36 0 1,15 * *'],
70-
['#hourly', '36 * * * *'],
71-
['#daily', '36 0 * * *'],
72-
['#weekly', '36 0 * * 6'],
73-
['#weekly@midnight', '36 0 * * 6'],
74-
['#monthly', '36 0 14 * *'],
75-
['#monthly@midnight', '36 0 14 * *'],
76-
['#yearly', '36 0 14 3 *'],
77-
['#yearly@midnight', '36 0 14 3 *'],
78-
['#annually', '36 0 14 3 *'],
79-
['#annually@midnight', '36 0 14 3 *'],
80-
['#midnight', '36 0 * * *'],
81-
['#(1-15) * * * *', '7 * * * *'],
82-
['#(1-15) * * * #(3-5)', '7 * * * 3'],
83-
['#(1-15) * # * #(3-5)', '7 * 1 * 5'],
36+
['# * * * *', '30 * * * *'],
37+
['# # * * *', '30 0 * * *'],
38+
['# # # * *', '30 0 25 * *'],
39+
['# # # # *', '30 0 25 10 *'],
40+
['# # # # #', '30 0 25 10 5'],
41+
['# # 1,15 1-11 *', '30 0 1,15 1-11 *'],
42+
['# # 1,15 * *', '30 0 1,15 * *'],
43+
['#hourly', '30 * * * *'],
44+
['#daily', '30 0 * * *'],
45+
['#weekly', '30 0 * * 3'],
46+
['#weekly@midnight', '30 0 * * 3'],
47+
['#monthly', '30 0 25 * *'],
48+
['#monthly@midnight', '30 0 25 * *'],
49+
['#yearly', '30 0 25 10 *'],
50+
['#yearly@midnight', '30 0 25 10 *'],
51+
['#annually', '30 0 25 10 *'],
52+
['#annually@midnight', '30 0 25 10 *'],
53+
['#midnight', '30 0 * * *'],
54+
['#(1-15) * * * *', '1 * * * *'],
55+
['#(1-15) * * * #(3-5)', '1 * * * 3'],
56+
['#(1-15) * # * #(3-5)', '1 * 17 * 5'],
8457
];
8558
}
8659

0 commit comments

Comments
 (0)