DX: more code style fixes

This commit is contained in:
2022-11-02 14:06:10 +01:00
parent 5655f953d7
commit 055acbf43c
21 changed files with 131 additions and 47 deletions

View File

@@ -342,7 +342,9 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase
// check that the person id is contained
$participationsPersonsIds = array_map(
static function ($participation) { return $participation->person->id; },
static function ($participation) {
return $participation->person->id;
},
$data->participations
);

View File

@@ -294,23 +294,49 @@ 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 function (Person $person) {
return $person->getFirstName();
}],
['lastName', 'random Value', static function (Person $person) {
return $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 function (Person $person) {
return $person->getPlaceOfBirth();
}],
['birthdate', '1980-12-15', static function (Person $person) {
return $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 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();
}],
//['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 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();
}],
];
}

View File

@@ -197,12 +197,24 @@ 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 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();
}],
];
}