Skip to content

Commit 1d52b7c

Browse files
committed
Fixed tests
1 parent 0d49632 commit 1d52b7c

File tree

4 files changed

+63
-63
lines changed

4 files changed

+63
-63
lines changed

tests/Controller/BulkInfoProviderImportControllerTest.php

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function testStep1WithoutIds(): void
4444
$client = static::createClient();
4545
$this->loginAsUser($client, 'admin');
4646

47-
$client->request('GET', '/tools/bulk-info-provider-import/step1');
47+
$client->request('GET', '/tools/bulk_info_provider_import/step1');
4848

4949
self::assertResponseRedirects();
5050
}
@@ -54,7 +54,7 @@ public function testStep1WithInvalidIds(): void
5454
$client = static::createClient();
5555
$this->loginAsUser($client, 'admin');
5656

57-
$client->request('GET', '/tools/bulk-info-provider-import/step1?ids=999999,888888');
57+
$client->request('GET', '/tools/bulk_info_provider_import/step1?ids=999999,888888');
5858

5959
self::assertResponseRedirects();
6060
}
@@ -64,7 +64,7 @@ public function testManagePage(): void
6464
$client = static::createClient();
6565
$this->loginAsUser($client, 'admin');
6666

67-
$client->request('GET', '/tools/bulk-info-provider-import/manage');
67+
$client->request('GET', '/tools/bulk_info_provider_import/manage');
6868

6969
// Follow any redirects (like locale redirects)
7070
if ($client->getResponse()->isRedirect()) {
@@ -78,11 +78,11 @@ public function testAccessControlForStep1(): void
7878
{
7979
$client = static::createClient();
8080

81-
$client->request('GET', '/tools/bulk-info-provider-import/step1?ids=1');
81+
$client->request('GET', '/tools/bulk_info_provider_import/step1?ids=1');
8282
self::assertResponseRedirects();
8383

8484
$this->loginAsUser($client, 'noread');
85-
$client->request('GET', '/tools/bulk-info-provider-import/step1?ids=1');
85+
$client->request('GET', '/tools/bulk_info_provider_import/step1?ids=1');
8686

8787
// Follow redirects if any, then check for 403 or final response
8888
if ($client->getResponse()->isRedirect()) {
@@ -100,11 +100,11 @@ public function testAccessControlForManage(): void
100100
{
101101
$client = static::createClient();
102102

103-
$client->request('GET', '/tools/bulk-info-provider-import/manage');
103+
$client->request('GET', '/tools/bulk_info_provider_import/manage');
104104
self::assertResponseRedirects();
105105

106106
$this->loginAsUser($client, 'noread');
107-
$client->request('GET', '/tools/bulk-info-provider-import/manage');
107+
$client->request('GET', '/tools/bulk_info_provider_import/manage');
108108

109109
// Follow redirects if any, then check for 403 or final response
110110
if ($client->getResponse()->isRedirect()) {
@@ -164,7 +164,7 @@ public function testStep2TemplateRendering(): void
164164
$entityManager->flush();
165165

166166
// Test that step2 renders correctly with the search results
167-
$client->request('GET', '/tools/bulk-info-provider-import/step2/' . $job->getId());
167+
$client->request('GET', '/tools/bulk_info_provider_import/step2/' . $job->getId());
168168

169169
// Follow any redirects (like locale redirects)
170170
if ($client->getResponse()->isRedirect()) {
@@ -201,7 +201,7 @@ public function testStep1WithValidIds(): void
201201
$this->markTestSkipped('Test part with ID 1 not found in fixtures');
202202
}
203203

204-
$client->request('GET', '/tools/bulk-info-provider-import/step1?ids=' . $part->getId());
204+
$client->request('GET', '/tools/bulk_info_provider_import/step1?ids=' . $part->getId());
205205

206206
if ($client->getResponse()->isRedirect()) {
207207
$client->followRedirect();
@@ -242,7 +242,7 @@ public function testDeleteJobWithValidJob(): void
242242
$entityManager->persist($job);
243243
$entityManager->flush();
244244

245-
$client->request('DELETE', '/en/tools/bulk-info-provider-import/job/' . $job->getId() . '/delete');
245+
$client->request('DELETE', '/en/tools/bulk_info_provider_import/job/' . $job->getId() . '/delete');
246246

247247
$this->assertResponseStatusCodeSame(Response::HTTP_OK);
248248
$response = json_decode($client->getResponse()->getContent(), true);
@@ -254,7 +254,7 @@ public function testDeleteJobWithNonExistentJob(): void
254254
$client = static::createClient();
255255
$this->loginAsUser($client, 'admin');
256256

257-
$client->request('DELETE', '/en/tools/bulk-info-provider-import/job/999999/delete');
257+
$client->request('DELETE', '/en/tools/bulk_info_provider_import/job/999999/delete');
258258

259259
$this->assertResponseStatusCodeSame(Response::HTTP_NOT_FOUND);
260260
$response = json_decode($client->getResponse()->getContent(), true);
@@ -289,7 +289,7 @@ public function testDeleteJobWithActiveJob(): void
289289
$entityManager->persist($job);
290290
$entityManager->flush();
291291

292-
$client->request('DELETE', '/en/tools/bulk-info-provider-import/job/' . $job->getId() . '/delete');
292+
$client->request('DELETE', '/en/tools/bulk_info_provider_import/job/' . $job->getId() . '/delete');
293293

294294
$this->assertResponseStatusCodeSame(Response::HTTP_BAD_REQUEST);
295295
$response = json_decode($client->getResponse()->getContent(), true);
@@ -328,7 +328,7 @@ public function testStopJobWithValidJob(): void
328328
$entityManager->persist($job);
329329
$entityManager->flush();
330330

331-
$client->request('POST', '/en/tools/bulk-info-provider-import/job/' . $job->getId() . '/stop');
331+
$client->request('POST', '/en/tools/bulk_info_provider_import/job/' . $job->getId() . '/stop');
332332

333333
$this->assertResponseStatusCodeSame(Response::HTTP_OK);
334334
$response = json_decode($client->getResponse()->getContent(), true);
@@ -344,7 +344,7 @@ public function testStopJobWithNonExistentJob(): void
344344
$client = static::createClient();
345345
$this->loginAsUser($client, 'admin');
346346

347-
$client->request('POST', '/en/tools/bulk-info-provider-import/job/999999/stop');
347+
$client->request('POST', '/en/tools/bulk_info_provider_import/job/999999/stop');
348348

349349
$this->assertResponseStatusCodeSame(Response::HTTP_NOT_FOUND);
350350
$response = json_decode($client->getResponse()->getContent(), true);
@@ -378,7 +378,7 @@ public function testMarkPartCompleted(): void
378378
$entityManager->persist($job);
379379
$entityManager->flush();
380380

381-
$client->request('POST', '/en/tools/bulk-info-provider-import/job/' . $job->getId() . '/part/1/mark-completed');
381+
$client->request('POST', '/en/tools/bulk_info_provider_import/job/' . $job->getId() . '/part/1/mark-completed');
382382

383383
$this->assertResponseStatusCodeSame(Response::HTTP_OK);
384384
$response = json_decode($client->getResponse()->getContent(), true);
@@ -418,7 +418,7 @@ public function testMarkPartSkipped(): void
418418
$entityManager->persist($job);
419419
$entityManager->flush();
420420

421-
$client->request('POST', '/en/tools/bulk-info-provider-import/job/' . $job->getId() . '/part/1/mark-skipped', [
421+
$client->request('POST', '/en/tools/bulk_info_provider_import/job/' . $job->getId() . '/part/1/mark-skipped', [
422422
'reason' => 'Test skip reason'
423423
]);
424424

@@ -459,7 +459,7 @@ public function testMarkPartPending(): void
459459
$entityManager->persist($job);
460460
$entityManager->flush();
461461

462-
$client->request('POST', '/en/tools/bulk-info-provider-import/job/' . $job->getId() . '/part/1/mark-pending');
462+
$client->request('POST', '/en/tools/bulk_info_provider_import/job/' . $job->getId() . '/part/1/mark-pending');
463463

464464
$this->assertResponseStatusCodeSame(Response::HTTP_OK);
465465
$response = json_decode($client->getResponse()->getContent(), true);
@@ -475,7 +475,7 @@ public function testStep2WithNonExistentJob(): void
475475
$client = static::createClient();
476476
$this->loginAsUser($client, 'admin');
477477

478-
$client->request('GET', '/tools/bulk-info-provider-import/step2/999999');
478+
$client->request('GET', '/tools/bulk_info_provider_import/step2/999999');
479479

480480
$this->assertResponseRedirects();
481481
}
@@ -511,7 +511,7 @@ public function testStep2WithUnauthorizedAccess(): void
511511

512512
// Try to access as readonly user
513513
$this->loginAsUser($client, 'noread');
514-
$client->request('GET', '/tools/bulk-info-provider-import/step2/' . $job->getId());
514+
$client->request('GET', '/tools/bulk_info_provider_import/step2/' . $job->getId());
515515

516516
$this->assertResponseRedirects();
517517

@@ -550,7 +550,7 @@ public function testJobAccessControlForDelete(): void
550550
$entityManager->flush();
551551

552552
// Try to delete as admin (should fail due to ownership)
553-
$client->request('DELETE', '/en/tools/bulk-info-provider-import/job/' . $job->getId() . '/delete');
553+
$client->request('DELETE', '/en/tools/bulk_info_provider_import/job/' . $job->getId() . '/delete');
554554

555555
$this->assertResponseStatusCodeSame(Response::HTTP_NOT_FOUND);
556556

@@ -601,7 +601,7 @@ public function testStep1Form(): void
601601
$this->markTestSkipped('Test part with ID 1 not found in fixtures');
602602
}
603603

604-
$client->request('GET', '/tools/bulk-info-provider-import/step1?ids=' . $part->getId());
604+
$client->request('GET', '/tools/bulk_info_provider_import/step1?ids=' . $part->getId());
605605

606606
if ($client->getResponse()->isRedirect()) {
607607
$client->followRedirect();
@@ -624,7 +624,7 @@ public function testStep1FormSubmissionWithErrors(): void
624624
$this->markTestSkipped('Test part with ID 1 not found in fixtures');
625625
}
626626

627-
$client->request('GET', '/tools/bulk-info-provider-import/step1?ids=' . $part->getId());
627+
$client->request('GET', '/tools/bulk_info_provider_import/step1?ids=' . $part->getId());
628628

629629
if ($client->getResponse()->isRedirect()) {
630630
$client->followRedirect();
@@ -694,7 +694,7 @@ public function testManagePageWithJobCleanup(): void
694694
$entityManager->persist($job);
695695
$entityManager->flush();
696696

697-
$client->request('GET', '/tools/bulk-info-provider-import/manage');
697+
$client->request('GET', '/tools/bulk_info_provider_import/manage');
698698

699699
if ($client->getResponse()->isRedirect()) {
700700
$client->followRedirect();
@@ -828,18 +828,18 @@ public function testJobAccessControlForStopAndMarkOperations(): void
828828
$entityManager->persist($job);
829829
$entityManager->flush();
830830

831-
$client->request('POST', '/en/tools/bulk-info-provider-import/job/' . $job->getId() . '/stop');
831+
$client->request('POST', '/en/tools/bulk_info_provider_import/job/' . $job->getId() . '/stop');
832832
$this->assertResponseStatusCodeSame(Response::HTTP_NOT_FOUND);
833833

834-
$client->request('POST', '/en/tools/bulk-info-provider-import/job/' . $job->getId() . '/part/1/mark-completed');
834+
$client->request('POST', '/en/tools/bulk_info_provider_import/job/' . $job->getId() . '/part/1/mark-completed');
835835
$this->assertResponseStatusCodeSame(Response::HTTP_NOT_FOUND);
836836

837-
$client->request('POST', '/en/tools/bulk-info-provider-import/job/' . $job->getId() . '/part/1/mark-skipped', [
837+
$client->request('POST', '/en/tools/bulk_info_provider_import/job/' . $job->getId() . '/part/1/mark-skipped', [
838838
'reason' => 'Test reason'
839839
]);
840840
$this->assertResponseStatusCodeSame(Response::HTTP_NOT_FOUND);
841841

842-
$client->request('POST', '/en/tools/bulk-info-provider-import/job/' . $job->getId() . '/part/1/mark-pending');
842+
$client->request('POST', '/en/tools/bulk_info_provider_import/job/' . $job->getId() . '/part/1/mark-pending');
843843
$this->assertResponseStatusCodeSame(Response::HTTP_NOT_FOUND);
844844

845845
// Find job from database to avoid detached entity errors
@@ -878,7 +878,7 @@ public function testOperationsOnCompletedJob(): void
878878
$entityManager->persist($job);
879879
$entityManager->flush();
880880

881-
$client->request('POST', '/en/tools/bulk-info-provider-import/job/' . $job->getId() . '/stop');
881+
$client->request('POST', '/en/tools/bulk_info_provider_import/job/' . $job->getId() . '/stop');
882882
$this->assertResponseStatusCodeSame(Response::HTTP_BAD_REQUEST);
883883
$response = json_decode($client->getResponse()->getContent(), true);
884884
$this->assertArrayHasKey('error', $response);

tests/DataTables/Filters/Constraints/Part/BulkImportJobStatusConstraintTest.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ protected function setUp(): void
4646

4747
public function testConstructor(): void
4848
{
49-
$this->assertEquals([], $this->constraint->getValues());
50-
$this->assertNull($this->constraint->getOperator());
49+
$this->assertEquals([], $this->constraint->getValue());
50+
$this->assertEmpty($this->constraint->getOperator());
5151
$this->assertFalse($this->constraint->isEnabled());
5252
}
5353

5454
public function testGetAndSetValues(): void
5555
{
5656
$values = ['pending', 'in_progress'];
57-
$this->constraint->setValues($values);
57+
$this->constraint->setValue($values);
5858

59-
$this->assertEquals($values, $this->constraint->getValues());
59+
$this->assertEquals($values, $this->constraint->getValue());
6060
}
6161

6262
public function testGetAndSetOperator(): void
@@ -76,14 +76,14 @@ public function testIsEnabledWithEmptyValues(): void
7676

7777
public function testIsEnabledWithNullOperator(): void
7878
{
79-
$this->constraint->setValues(['pending']);
79+
$this->constraint->setValue(['pending']);
8080

8181
$this->assertFalse($this->constraint->isEnabled());
8282
}
8383

8484
public function testIsEnabledWithValuesAndOperator(): void
8585
{
86-
$this->constraint->setValues(['pending']);
86+
$this->constraint->setValue(['pending']);
8787
$this->constraint->setOperator('ANY');
8888

8989
$this->assertTrue($this->constraint->isEnabled());
@@ -101,7 +101,7 @@ public function testApplyWithEmptyValues(): void
101101

102102
public function testApplyWithNullOperator(): void
103103
{
104-
$this->constraint->setValues(['pending']);
104+
$this->constraint->setValue(['pending']);
105105

106106
$this->queryBuilder->expects($this->never())
107107
->method('andWhere');
@@ -111,7 +111,7 @@ public function testApplyWithNullOperator(): void
111111

112112
public function testApplyWithAnyOperator(): void
113113
{
114-
$this->constraint->setValues(['pending', 'in_progress']);
114+
$this->constraint->setValue(['pending', 'in_progress']);
115115
$this->constraint->setOperator('ANY');
116116

117117
$subQueryBuilder = $this->createMock(QueryBuilder::class);
@@ -138,7 +138,7 @@ public function testApplyWithAnyOperator(): void
138138

139139
public function testApplyWithNoneOperator(): void
140140
{
141-
$this->constraint->setValues(['completed']);
141+
$this->constraint->setValue(['completed']);
142142
$this->constraint->setOperator('NONE');
143143

144144
$subQueryBuilder = $this->createMock(QueryBuilder::class);
@@ -165,7 +165,7 @@ public function testApplyWithNoneOperator(): void
165165

166166
public function testApplyWithUnsupportedOperator(): void
167167
{
168-
$this->constraint->setValues(['pending']);
168+
$this->constraint->setValue(['pending']);
169169
$this->constraint->setOperator('UNKNOWN');
170170

171171
$subQueryBuilder = $this->createMock(QueryBuilder::class);
@@ -187,7 +187,7 @@ public function testApplyWithUnsupportedOperator(): void
187187

188188
public function testSubqueryStructure(): void
189189
{
190-
$this->constraint->setValues(['pending']);
190+
$this->constraint->setValue(['pending']);
191191
$this->constraint->setOperator('ANY');
192192

193193
$subQueryBuilder = $this->createMock(QueryBuilder::class);
@@ -231,17 +231,17 @@ public function testSubqueryStructure(): void
231231
public function testValuesAndOperatorMutation(): void
232232
{
233233
// Test that values and operator can be changed after creation
234-
$this->constraint->setValues(['pending']);
234+
$this->constraint->setValue(['pending']);
235235
$this->constraint->setOperator('ANY');
236236
$this->assertTrue($this->constraint->isEnabled());
237237

238-
$this->constraint->setValues([]);
238+
$this->constraint->setValue([]);
239239
$this->assertFalse($this->constraint->isEnabled());
240240

241-
$this->constraint->setValues(['completed']);
241+
$this->constraint->setValue(['completed']);
242242
$this->assertTrue($this->constraint->isEnabled());
243243

244-
$this->constraint->setOperator(null);
244+
$this->constraint->setOperator('');
245245
$this->assertFalse($this->constraint->isEnabled());
246246

247247
$this->constraint->setOperator('NONE');

0 commit comments

Comments
 (0)