Skip to content

Commit fe3c230

Browse files
authored
Merge pull request #64 from biigle/laravel-10
Update tests for Laravel 10
2 parents 66bdaca + 442cbd1 commit fe3c230

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

tests/Http/Controllers/Api/LaserpointsControllerTest.php

+10-7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Biigle\Tests\ImageAnnotationTest;
1414
use Biigle\Tests\ImageTest;
1515
use Biigle\Tests\LabelTest;
16+
use Queue;
1617

1718
class LaserpointsControllerTest extends ApiTestCase
1819
{
@@ -37,13 +38,14 @@ public function testComputeImage()
3738

3839
$this->makeManualAnnotations($label, 3);
3940

40-
$this->expectsJobs(ProcessImageDelphiJob::class);
4141
$this->postJson("/api/v1/images/{$image->id}/laserpoints/area", [
4242
'distance' => 50,
4343
'label_id' => $label->id,
4444
])
4545
->assertStatus(200);
4646

47+
Queue::assertPushed(ProcessImageDelphiJob::class);
48+
4749
// Distance is required.
4850
$this->postJson("/api/v1/images/{$image->id}/laserpoints/area", [
4951
'label_id' => $label->id,
@@ -82,12 +84,13 @@ public function testComputeImage()
8284
$this->makeManualAnnotations($label, 2, 1);
8385
$image = Image::first();
8486

85-
$this->expectsJobs(ProcessImageManualJob::class);
8687
$this->post("/api/v1/images/{$image->id}/laserpoints/area", [
8788
'distance' => 50,
8889
'label_id' => $label->id,
8990
])
9091
->assertStatus(200);
92+
93+
Queue::assertPushed(ProcessImageManualJob::class);
9194
}
9295

9396
public function testComputeImageRemote()
@@ -99,12 +102,12 @@ public function testComputeImageRemote()
99102
$this->makeManualAnnotations($label, 3);
100103

101104
$this->beEditor();
102-
$this->expectsJobs(ProcessImageDelphiJob::class);
103105
$this->postJson("/api/v1/images/{$image->id}/laserpoints/area", [
104106
'distance' => 50,
105107
'label_id' => $label->id,
106108
])
107109
->assertStatus(200);
110+
Queue::assertPushed(ProcessImageDelphiJob::class);
108111
}
109112

110113
public function testComputeImageTiled()
@@ -114,12 +117,12 @@ public function testComputeImageTiled()
114117
$this->makeManualAnnotations($label, 3);
115118

116119
$this->beEditor();
117-
$this->doesntExpectJobs(ProcessImageDelphiJob::class);
118120
$this->postJson("/api/v1/images/{$image->id}/laserpoints/area", [
119121
'distance' => 50,
120122
'label_id' => $label->id,
121123
])
122124
->assertStatus(422);
125+
Queue::assertNotPushed(ProcessImageDelphiJob::class);
123126
}
124127

125128
public function testComputeVolume()
@@ -133,12 +136,12 @@ public function testComputeVolume()
133136

134137
$this->beEditor();
135138
$this->makeManualAnnotations($label, 3);
136-
$this->expectsJobs(ProcessVolumeDelphiJob::class);
137139
$this->postJson("/api/v1/volumes/{$id}/laserpoints/area", [
138140
'distance' => 50,
139141
'label_id' => $label->id,
140142
])
141143
->assertStatus(200);
144+
Queue::assertPushed(ProcessVolumeDelphiJob::class);
142145
}
143146

144147
public function testComputeVolumeValidation()
@@ -203,12 +206,12 @@ public function testComputeVolumeRemote()
203206
$this->makeManualAnnotations($label, 3);
204207

205208
$this->beEditor();
206-
$this->expectsJobs(ProcessVolumeDelphiJob::class);
207209
$this->postJson("/api/v1/volumes/{$id}/laserpoints/area", [
208210
'distance' => 50,
209211
'label_id' => $label->id,
210212
])
211213
->assertStatus(200);
214+
Queue::assertPushed(ProcessVolumeDelphiJob::class);
212215
}
213216

214217
public function testComputeVolumeTiled()
@@ -219,12 +222,12 @@ public function testComputeVolumeTiled()
219222
$this->makeManualAnnotations($label, 3);
220223

221224
$this->beEditor();
222-
$this->doesntExpectJobs(ProcessVolumeDelphiJob::class);
223225
$this->postJson("/api/v1/volumes/{$id}/laserpoints/area", [
224226
'distance' => 50,
225227
'label_id' => $label->id,
226228
])
227229
->assertStatus(422);
230+
Queue::assertNotPushed(ProcessVolumeDelphiJob::class);
228231
}
229232

230233
public function testComputeVideoVolume()

0 commit comments

Comments
 (0)