|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Zenstruck\ScheduleBundle\Tests\Schedule\Task; |
|
4
|
|
|
|
|
5
|
|
|
use PHPUnit\Framework\TestCase; |
|
|
|
|
|
|
6
|
|
|
use Symfony\Component\Messenger\Envelope; |
|
7
|
|
|
use Symfony\Component\Messenger\Stamp\DelayStamp; |
|
8
|
|
|
use Symfony\Component\Messenger\Stamp\ValidationStamp; |
|
9
|
|
|
use Zenstruck\ScheduleBundle\Schedule\Task\MessageTask; |
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* @author Kevin Bond <[email protected]> |
|
13
|
|
|
*/ |
|
14
|
|
|
final class MessageTaskTest extends TestCase |
|
15
|
|
|
{ |
|
16
|
|
|
/** |
|
17
|
|
|
* @test |
|
18
|
|
|
*/ |
|
19
|
|
|
public function object_class_is_set_as_default_description(): void |
|
20
|
|
|
{ |
|
21
|
|
|
$this->assertSame(self::class, (new MessageTask($this))->getDescription()); |
|
22
|
|
|
$this->assertSame(self::class, (new MessageTask(new Envelope($this)))->getDescription()); |
|
23
|
|
|
} |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* @test |
|
27
|
|
|
*/ |
|
28
|
|
|
public function context_with_no_stamps(): void |
|
29
|
|
|
{ |
|
30
|
|
|
$this->assertSame( |
|
31
|
|
|
[ |
|
32
|
|
|
'Message' => self::class, |
|
33
|
|
|
'Stamps' => '(none)', |
|
34
|
|
|
], |
|
35
|
|
|
(new MessageTask($this))->getContext() |
|
36
|
|
|
); |
|
37
|
|
|
$this->assertSame( |
|
38
|
|
|
[ |
|
39
|
|
|
'Message' => self::class, |
|
40
|
|
|
'Stamps' => '(none)', |
|
41
|
|
|
], |
|
42
|
|
|
(new MessageTask(new Envelope($this)))->getContext() |
|
43
|
|
|
); |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @test |
|
48
|
|
|
*/ |
|
49
|
|
|
public function context_with_stamps(): void |
|
50
|
|
|
{ |
|
51
|
|
|
$this->assertSame( |
|
52
|
|
|
[ |
|
53
|
|
|
'Message' => self::class, |
|
54
|
|
|
'Stamps' => 'DelayStamp, ValidationStamp', |
|
55
|
|
|
], |
|
56
|
|
|
(new MessageTask($this, [new DelayStamp(4), new ValidationStamp([])]))->getContext() |
|
57
|
|
|
); |
|
58
|
|
|
$this->assertSame( |
|
59
|
|
|
[ |
|
60
|
|
|
'Message' => self::class, |
|
61
|
|
|
'Stamps' => 'DelayStamp, ValidationStamp', |
|
62
|
|
|
], |
|
63
|
|
|
(new MessageTask(new Envelope($this, [new DelayStamp(4)]), [new ValidationStamp([]), new DelayStamp(4)]))->getContext() |
|
64
|
|
|
); |
|
65
|
|
|
} |
|
66
|
|
|
} |
|
67
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths