mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 07:33:50 +00:00
DX: apply rector rulesets up to PHP 73
This commit is contained in:
@@ -313,10 +313,10 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
|
||||
[], // parameters
|
||||
[], // files
|
||||
[], // server parameters
|
||||
json_encode(['type' => 'person', 'id' => $personId])
|
||||
json_encode(['type' => 'person', 'id' => $personId], JSON_THROW_ON_ERROR)
|
||||
);
|
||||
$response = $this->client->getResponse();
|
||||
$data = json_decode($response->getContent(), true);
|
||||
$data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR);
|
||||
|
||||
$this->assertTrue(in_array($response->getStatusCode(), [200, 422], true));
|
||||
|
||||
@@ -338,7 +338,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
|
||||
}
|
||||
|
||||
$response = $this->client->getResponse();
|
||||
$data = json_decode($response->getContent());
|
||||
$data = json_decode($response->getContent(), null, 512, JSON_THROW_ON_ERROR);
|
||||
|
||||
// check that the person id is contained
|
||||
$participationsPersonsIds = array_map(
|
||||
@@ -357,10 +357,10 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
|
||||
[], // parameters
|
||||
[], // files
|
||||
[], // server parameters
|
||||
json_encode(['type' => 'person', 'id' => $personId])
|
||||
json_encode(['type' => 'person', 'id' => $personId], JSON_THROW_ON_ERROR)
|
||||
);
|
||||
$response = $this->client->getResponse();
|
||||
$data = json_decode($response->getContent(), true);
|
||||
$data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR);
|
||||
|
||||
$this->assertTrue(in_array($response->getStatusCode(), [200, 422], true));
|
||||
|
||||
@@ -387,7 +387,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
|
||||
[],
|
||||
[],
|
||||
[],
|
||||
json_encode(['type' => 'social_issue', 'id' => $si->getId()])
|
||||
json_encode(['type' => 'social_issue', 'id' => $si->getId()], JSON_THROW_ON_ERROR)
|
||||
);
|
||||
|
||||
$this->assertTrue(in_array($this->client->getResponse()->getStatusCode(), [200, 422], true));
|
||||
@@ -396,7 +396,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
|
||||
$this->markTestSkipped('the next tests should appears only on valid accompanying period');
|
||||
}
|
||||
|
||||
$data = json_decode($this->client->getResponse()->getContent(), true);
|
||||
$data = json_decode($this->client->getResponse()->getContent(), true, 512, JSON_THROW_ON_ERROR);
|
||||
$this->assertArrayHasKey('id', $data);
|
||||
$this->assertArrayHasKey('type', $data);
|
||||
$this->assertEquals('social_issue', $data['type']);
|
||||
@@ -407,7 +407,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
|
||||
[],
|
||||
[],
|
||||
[],
|
||||
json_encode(['type' => 'social_issue', 'id' => $si->getId()])
|
||||
json_encode(['type' => 'social_issue', 'id' => $si->getId()], JSON_THROW_ON_ERROR)
|
||||
);
|
||||
|
||||
$this->assertTrue(in_array($this->client->getResponse()->getStatusCode(), [200, 422], true));
|
||||
@@ -427,7 +427,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
|
||||
$this->markTestSkipped('the next tests should appears only on valid accompanying period');
|
||||
}
|
||||
|
||||
$data = json_decode($response->getContent());
|
||||
$data = json_decode($response->getContent(), null, 512, JSON_THROW_ON_ERROR);
|
||||
$this->assertEquals(
|
||||
$data->id,
|
||||
$periodId,
|
||||
@@ -453,7 +453,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
|
||||
[], // parameters
|
||||
[], // files
|
||||
[], // server parameters
|
||||
json_encode(['type' => 'accompanying_period', 'emergency' => !$initialValueEmergency])
|
||||
json_encode(['type' => 'accompanying_period', 'emergency' => !$initialValueEmergency], JSON_THROW_ON_ERROR)
|
||||
);
|
||||
$response = $this->client->getResponse();
|
||||
|
||||
@@ -492,7 +492,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
|
||||
json_encode(['type' => 'accompanying_period_comment', 'content' => 'this is a text'])
|
||||
);
|
||||
$response = $this->client->getResponse();
|
||||
$data = json_decode($response->getContent(), true);
|
||||
$data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR);
|
||||
|
||||
$this->assertTrue(in_array($response->getStatusCode(), [200, 422], true));
|
||||
|
||||
@@ -508,10 +508,10 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
|
||||
[], // parameters
|
||||
[], // files
|
||||
[], // server parameters
|
||||
json_encode(['type' => 'accompanying_period_comment', 'id' => $data['id']])
|
||||
json_encode(['type' => 'accompanying_period_comment', 'id' => $data['id']], JSON_THROW_ON_ERROR)
|
||||
);
|
||||
$response = $this->client->getResponse();
|
||||
$data = json_decode($response->getContent(), true);
|
||||
$data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR);
|
||||
|
||||
$this->assertTrue(in_array($response->getStatusCode(), [200, 422], true));
|
||||
}
|
||||
@@ -568,10 +568,10 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
|
||||
[], // parameters
|
||||
[], // files
|
||||
[], // server parameters
|
||||
json_encode(['type' => 'person', 'id' => $personId])
|
||||
json_encode(['type' => 'person', 'id' => $personId], JSON_THROW_ON_ERROR)
|
||||
);
|
||||
$response = $this->client->getResponse();
|
||||
$data = json_decode($response->getContent(), true);
|
||||
$data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR);
|
||||
|
||||
$this->assertTrue(in_array($response->getStatusCode(), [200, 422], true));
|
||||
|
||||
@@ -595,10 +595,10 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
|
||||
[], // parameters
|
||||
[], // files
|
||||
[], // server parameters
|
||||
json_encode(['type' => 'thirdparty', 'id' => $thirdPartyId])
|
||||
json_encode(['type' => 'thirdparty', 'id' => $thirdPartyId], JSON_THROW_ON_ERROR)
|
||||
);
|
||||
$response = $this->client->getResponse();
|
||||
$data = json_decode($response->getContent(), true);
|
||||
$data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR);
|
||||
|
||||
$this->assertTrue(in_array($response->getStatusCode(), [200, 422], true));
|
||||
|
||||
@@ -655,7 +655,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
|
||||
json_encode(['type' => 'accompanying_period_resource', 'resource' => ['type' => 'person', 'id' => $personId]])
|
||||
);
|
||||
$response = $this->client->getResponse();
|
||||
$data = json_decode($response->getContent(), true);
|
||||
$data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR);
|
||||
|
||||
$this->assertTrue(in_array($response->getStatusCode(), [200, 422], true));
|
||||
|
||||
@@ -680,7 +680,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
|
||||
[],
|
||||
[],
|
||||
[], //server
|
||||
json_encode(['type' => 'accompanying_period_resource', 'id' => $resource->getId()])
|
||||
json_encode(['type' => 'accompanying_period_resource', 'id' => $resource->getId()], JSON_THROW_ON_ERROR)
|
||||
);
|
||||
$response = $this->client->getResponse();
|
||||
$this->assertTrue(in_array($response->getStatusCode(), [200, 422], true));
|
||||
@@ -699,7 +699,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
|
||||
json_encode(['type' => 'accompanying_period_resource', 'resource' => ['type' => 'thirdparty', 'id' => $thirdPartyId]])
|
||||
);
|
||||
$response = $this->client->getResponse();
|
||||
$data = json_decode($response->getContent(), true);
|
||||
$data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR);
|
||||
|
||||
$this->assertTrue(in_array($response->getStatusCode(), [200, 422], true));
|
||||
|
||||
@@ -724,7 +724,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
|
||||
[],
|
||||
[],
|
||||
[], //server
|
||||
json_encode(['type' => 'accompanying_period_resource', 'id' => $resource->getId()])
|
||||
json_encode(['type' => 'accompanying_period_resource', 'id' => $resource->getId()], JSON_THROW_ON_ERROR)
|
||||
);
|
||||
$response = $this->client->getResponse();
|
||||
$this->assertTrue(in_array($response->getStatusCode(), [200, 422], true));
|
||||
|
@@ -157,7 +157,7 @@ final class HouseholdApiControllerTest extends WebTestCase
|
||||
);
|
||||
|
||||
$this->assertResponseIsSuccessful();
|
||||
$data = json_decode($client->getResponse()->getContent(), true);
|
||||
$data = json_decode($client->getResponse()->getContent(), true, 512, JSON_THROW_ON_ERROR);
|
||||
$this->assertArrayHasKey('count', $data);
|
||||
$this->assertArrayHasKey('results', $data);
|
||||
|
||||
|
@@ -179,7 +179,7 @@ final class HouseholdMemberControllerTest extends WebTestCase
|
||||
$client->getResponse()->getStatusCode()
|
||||
);
|
||||
|
||||
$data = json_decode($client->getResponse()->getContent(), true);
|
||||
$data = json_decode($client->getResponse()->getContent(), true, 512, JSON_THROW_ON_ERROR);
|
||||
|
||||
$this->assertEquals(null, $data);
|
||||
}
|
||||
@@ -284,7 +284,7 @@ final class HouseholdMemberControllerTest extends WebTestCase
|
||||
$client->getResponse()->getStatusCode()
|
||||
);
|
||||
|
||||
$data = json_decode($client->getResponse()->getContent(), true);
|
||||
$data = json_decode($client->getResponse()->getContent(), true, 512, JSON_THROW_ON_ERROR);
|
||||
|
||||
$this->assertIsArray($data);
|
||||
$this->assertArrayHasKey('members', $data);
|
||||
|
@@ -112,7 +112,7 @@ final class PersonApiControllerTest extends WebTestCase
|
||||
|
||||
$this->assertResponseIsSuccessful();
|
||||
|
||||
$data = json_decode($client->getResponse()->getContent(), true);
|
||||
$data = json_decode($client->getResponse()->getContent(), true, 512, JSON_THROW_ON_ERROR);
|
||||
|
||||
$this->assertArrayHasKey('type', $data);
|
||||
$this->assertArrayHasKey('id', $data);
|
||||
|
@@ -136,7 +136,7 @@ final class RelationshipApiControllerTest extends WebTestCase
|
||||
'toPerson' => ['id' => $toPersonId, 'type' => 'person'],
|
||||
'relation' => ['id' => $relationId, 'type' => 'relation'],
|
||||
'reverse' => $isReverse,
|
||||
])
|
||||
], JSON_THROW_ON_ERROR)
|
||||
);
|
||||
|
||||
$response = $this->client->getResponse();
|
||||
|
@@ -47,7 +47,7 @@ final class SocialIssueApiControllerTest extends WebTestCase
|
||||
|
||||
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
||||
|
||||
$data = json_decode($client->getResponse()->getContent(), true);
|
||||
$data = json_decode($client->getResponse()->getContent(), true, 512, JSON_THROW_ON_ERROR);
|
||||
|
||||
$this->assertArrayHasKey('id', $data);
|
||||
$this->assertArrayHasKey('type', $data);
|
||||
@@ -60,7 +60,7 @@ final class SocialIssueApiControllerTest extends WebTestCase
|
||||
|
||||
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
||||
|
||||
$data = json_decode($client->getResponse()->getContent(), true);
|
||||
$data = json_decode($client->getResponse()->getContent(), true, 512, JSON_THROW_ON_ERROR);
|
||||
|
||||
$this->assertGreaterThan(0, $data['count']);
|
||||
$this->assertGreaterThan(0, count($data['results']));
|
||||
|
@@ -77,7 +77,7 @@ final class SocialWorkEvaluationApiControllerTest extends WebTestCase
|
||||
|
||||
$this->assertResponseIsSuccessful();
|
||||
|
||||
$content = json_decode($client->getResponse()->getContent(), true);
|
||||
$content = json_decode($client->getResponse()->getContent(), true, 512, JSON_THROW_ON_ERROR);
|
||||
|
||||
$ids = array_map(static fn (array $item) => $item['id'], $content['results']);
|
||||
|
||||
|
Reference in New Issue
Block a user