mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 07:33:50 +00:00
DX: rector rules upt to PHP 74
This commit is contained in:
@@ -342,9 +342,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
|
||||
|
||||
// check that the person id is contained
|
||||
$participationsPersonsIds = array_map(
|
||||
static function ($participation) {
|
||||
return $participation->person->id;
|
||||
},
|
||||
static fn($participation) => $participation->person->id,
|
||||
$data->participations
|
||||
);
|
||||
|
||||
|
@@ -161,9 +161,7 @@ final class HouseholdApiControllerTest extends WebTestCase
|
||||
$this->assertArrayHasKey('count', $data);
|
||||
$this->assertArrayHasKey('results', $data);
|
||||
|
||||
$householdIds = array_map(static function ($r) {
|
||||
return $r['id'];
|
||||
}, $data['results']);
|
||||
$householdIds = array_map(static fn($r) => $r['id'], $data['results']);
|
||||
|
||||
$this->assertContains($expectedHouseholdId, $householdIds);
|
||||
}
|
||||
|
@@ -294,49 +294,23 @@ final class PersonControllerUpdateTest extends WebTestCase
|
||||
public function validTextFieldsProvider()
|
||||
{
|
||||
return [
|
||||
['firstName', 'random Value', static function (Person $person) {
|
||||
return $person->getFirstName();
|
||||
}],
|
||||
['lastName', 'random Value', static function (Person $person) {
|
||||
return $person->getLastName();
|
||||
}],
|
||||
['firstName', 'random Value', static fn(Person $person) => $person->getFirstName()],
|
||||
['lastName', 'random Value', static fn(Person $person) => $person->getLastName()],
|
||||
// reminder: this value is capitalized
|
||||
['placeOfBirth', 'A PLACE', static function (Person $person) {
|
||||
return $person->getPlaceOfBirth();
|
||||
}],
|
||||
['birthdate', '1980-12-15', static function (Person $person) {
|
||||
return $person->getBirthdate()->format('Y-m-d');
|
||||
}],
|
||||
['placeOfBirth', 'A PLACE', static fn(Person $person) => $person->getPlaceOfBirth()],
|
||||
['birthdate', '1980-12-15', static fn(Person $person) => $person->getBirthdate()->format('Y-m-d')],
|
||||
// TODO test on phonenumber update
|
||||
// ['phonenumber', '+32123456789', static function (Person $person) { return $person->getPhonenumber(); }],
|
||||
['memo', 'jfkdlmq jkfldmsq jkmfdsq', static function (Person $person) {
|
||||
return $person->getMemo();
|
||||
}],
|
||||
['countryOfBirth', 'BE', static function (Person $person) {
|
||||
return $person->getCountryOfBirth()->getCountryCode();
|
||||
}],
|
||||
['nationality', 'FR', static function (Person $person) {
|
||||
return $person->getNationality()->getCountryCode();
|
||||
}],
|
||||
['placeOfBirth', '', static function (Person $person) {
|
||||
return $person->getPlaceOfBirth();
|
||||
}],
|
||||
['birthdate', '', static function (Person $person) {
|
||||
return $person->getBirthdate();
|
||||
}],
|
||||
['memo', 'jfkdlmq jkfldmsq jkmfdsq', static fn(Person $person) => $person->getMemo()],
|
||||
['countryOfBirth', 'BE', static fn(Person $person) => $person->getCountryOfBirth()->getCountryCode()],
|
||||
['nationality', 'FR', static fn(Person $person) => $person->getNationality()->getCountryCode()],
|
||||
['placeOfBirth', '', static fn(Person $person) => $person->getPlaceOfBirth()],
|
||||
['birthdate', '', static fn(Person $person) => $person->getBirthdate()],
|
||||
//['phonenumber', '', static function (Person $person) { return $person->getPhonenumber(); }],
|
||||
['memo', '', static function (Person $person) {
|
||||
return $person->getMemo();
|
||||
}],
|
||||
['countryOfBirth', null, static function (Person $person) {
|
||||
return $person->getCountryOfBirth();
|
||||
}],
|
||||
['nationality', null, static function (Person $person) {
|
||||
return $person->getNationality();
|
||||
}],
|
||||
['gender', Person::FEMALE_GENDER, static function (Person $person) {
|
||||
return $person->getGender();
|
||||
}],
|
||||
['memo', '', static fn(Person $person) => $person->getMemo()],
|
||||
['countryOfBirth', null, static fn(Person $person) => $person->getCountryOfBirth()],
|
||||
['nationality', null, static fn(Person $person) => $person->getNationality()],
|
||||
['gender', Person::FEMALE_GENDER, static fn(Person $person) => $person->getGender()],
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -197,24 +197,12 @@ final class PersonControllerUpdateWithHiddenFieldsTest extends WebTestCase
|
||||
public function validTextFieldsProvider()
|
||||
{
|
||||
return [
|
||||
['firstName', 'random Value', static function (Person $person) {
|
||||
return $person->getFirstName();
|
||||
}],
|
||||
['lastName', 'random Value', static function (Person $person) {
|
||||
return $person->getLastName();
|
||||
}],
|
||||
['birthdate', '15-12-1980', static function (Person $person) {
|
||||
return $person->getBirthdate()->format('d-m-Y');
|
||||
}],
|
||||
['memo', 'jfkdlmq jkfldmsq jkmfdsq', static function (Person $person) {
|
||||
return $person->getMemo();
|
||||
}],
|
||||
['birthdate', '', static function (Person $person) {
|
||||
return $person->getBirthdate();
|
||||
}],
|
||||
['gender', Person::FEMALE_GENDER, static function (Person $person) {
|
||||
return $person->getGender();
|
||||
}],
|
||||
['firstName', 'random Value', static fn(Person $person) => $person->getFirstName()],
|
||||
['lastName', 'random Value', static fn(Person $person) => $person->getLastName()],
|
||||
['birthdate', '15-12-1980', static fn(Person $person) => $person->getBirthdate()->format('d-m-Y')],
|
||||
['memo', 'jfkdlmq jkfldmsq jkmfdsq', static fn(Person $person) => $person->getMemo()],
|
||||
['birthdate', '', static fn(Person $person) => $person->getBirthdate()],
|
||||
['gender', Person::FEMALE_GENDER, static fn(Person $person) => $person->getGender()],
|
||||
];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user