Skip to content

MQE-1065: Persisted data are not resolved correctly when using with ParameterArray #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 18, 2018

Conversation

jilu1
Copy link
Contributor

@jilu1 jilu1 commented Sep 10, 2018

Description

MQE-1065: Persisted data are not resolved correctly when using with ParameterArray

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/verification tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)
  • Changes to Framework doesn't have backward incompatible changes for tests or have related Pull Request with fixes to tests

@coveralls
Copy link

coveralls commented Sep 10, 2018

Coverage Status

Coverage increased (+0.2%) to 57.366% when pulling ded92ff on MQE-1065 into 31ddcc8 on develop.

…arameterArray

- addressed static test failures
@jilu1 jilu1 changed the title [MFTF 2.3.7] Bug fix MQE-1065 [MFTF 2.3.7] Bug fix MQE-1065: Persisted data are not resolved correctly when using with ParameterArray Sep 13, 2018
@jilu1 jilu1 changed the title [MFTF 2.3.7] Bug fix MQE-1065: Persisted data are not resolved correctly when using with ParameterArray [2.3.7] Bug fix MQE-1065: Persisted data are not resolved correctly when using with ParameterArray Sep 13, 2018
Copy link
Contributor

@KevinBKozan KevinBKozan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good and works as expected, just need some documentation updates to clarify reasoning behind some lines.

$arrayResult = [];
$count = 0;

// matches arrays
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need a little more commenting on here, what's actually happening is more like
find arrays, replace them with placeholder to prevent manipulation in foreach below

preg_match_all('/[\[][^\]]*?[\]]/', $input, $paramInput);
if (!empty($paramInput)) {
foreach ($paramInput[0] as $param) {
$arrayResult[static::PRESSKEY_ARRAY_ANCHOR_KEY . $count] =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We call class constants as self::CONSTANT_NAME everywhere else in the framework, may be worth doing the same here.

}

$result = implode(',', $result);
if (!empty($arrayResult)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment here:
Reinsert arrays into result

@KevinBKozan KevinBKozan changed the title [2.3.7] Bug fix MQE-1065: Persisted data are not resolved correctly when using with ParameterArray MQE-1065: Persisted data are not resolved correctly when using with ParameterArray Sep 14, 2018
@KevinBKozan
Copy link
Contributor

@jilu1 changes are good to go. I changed the title of the PR to conform to normal MQE-###: Description format.

@jilu1 jilu1 merged commit d02fe0c into develop Sep 18, 2018
@jilu1 jilu1 deleted the MQE-1065 branch November 6, 2018 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants