7
7
use Illuminate \Support \Facades \Event ;
8
8
use Illuminate \Support \Facades \Queue ;
9
9
use Orchestra \Testbench \TestCase ;
10
+ use PHPUnit \Framework \Attributes \Test ;
10
11
use Spatie \Valuestore \Valuestore ;
11
12
use Stancl \JobPipeline \JobPipeline ;
12
13
@@ -26,7 +27,7 @@ public function setUp(): void
26
27
$ this ->valuestore = Valuestore::make (__DIR__ . '/tmp/jobpipelinetest.json ' )->flush ();
27
28
}
28
29
29
- /** @test */
30
+ #[Test]
30
31
public function job_pipeline_can_listen_to_any_event ()
31
32
{
32
33
Event::listen (TestEvent::class, JobPipeline::make ([
@@ -42,7 +43,7 @@ public function job_pipeline_can_listen_to_any_event()
42
43
$ this ->assertSame ('bar ' , $ this ->valuestore ->get ('foo ' ));
43
44
}
44
45
45
- /** @test */
46
+ #[Test]
46
47
public function job_pipeline_can_be_queued ()
47
48
{
48
49
Queue::fake ();
@@ -63,7 +64,7 @@ public function job_pipeline_can_be_queued()
63
64
});
64
65
}
65
66
66
- /** @test */
67
+ #[Test]
67
68
public function job_pipelines_run_when_queued ()
68
69
{
69
70
Event::listen (TestEvent::class, JobPipeline::make ([
@@ -81,7 +82,7 @@ public function job_pipelines_run_when_queued()
81
82
$ this ->assertSame ('bar ' , $ this ->valuestore ->get ('foo ' ));
82
83
}
83
84
84
- /** @test */
85
+ #[Test]
85
86
public function job_pipeline_executes_jobs_and_passes_the_object_sequentially ()
86
87
{
87
88
Event::listen (TestEvent::class, JobPipeline::make ([
@@ -98,7 +99,7 @@ public function job_pipeline_executes_jobs_and_passes_the_object_sequentially()
98
99
$ this ->assertSame ('first job changed property ' , $ this ->valuestore ->get ('foo ' ));
99
100
}
100
101
101
- /** @test */
102
+ #[Test]
102
103
public function send_can_return_multiple_arguments ()
103
104
{
104
105
Event::listen (TestEvent::class, JobPipeline::make ([
@@ -114,7 +115,7 @@ public function send_can_return_multiple_arguments()
114
115
$ this ->assertSame (['a ' , 'b ' ], app ('test_args ' ));
115
116
}
116
117
117
- /** @test */
118
+ #[Test]
118
119
public function the_pipeline_can_be_canceled_by_returning_false_from_any_job ()
119
120
{
120
121
Event::listen (TestEvent::class, JobPipeline::make ([
@@ -134,8 +135,8 @@ public function the_pipeline_can_be_canceled_by_returning_false_from_any_job()
134
135
// Foo job is not excuted
135
136
$ this ->assertFalse ($ this ->valuestore ->has ('foo ' ));
136
137
}
137
-
138
- /** @test */
138
+
139
+ #[Test]
139
140
public function the_pipeline_can_execute_failed_method_on_job ()
140
141
{
141
142
Event::listen (TestEvent::class, JobPipeline::make ([
@@ -151,7 +152,7 @@ public function the_pipeline_can_execute_failed_method_on_job()
151
152
$ this ->assertEquals ($ this ->valuestore ->get ('exeception ' ), 'pipeline exception ' );
152
153
}
153
154
154
- /** @test */
155
+ #[Test]
155
156
public function closures_can_be_used_as_jobs ()
156
157
{
157
158
$ passes = false ;
@@ -169,7 +170,7 @@ function (TestModel $model) use (&$passes) {
169
170
$ this ->assertTrue ($ passes );
170
171
}
171
172
172
- /** @test */
173
+ #[Test]
173
174
public function failures_in_closures_will_throw_correctly ()
174
175
{
175
176
$ this ->expectExceptionMessage ('foobar ' );
0 commit comments