Skip to content

Commit 8ebe7e6

Browse files
committed
B2B-582: Update history log messages for Order Approvals
- test update
1 parent 4a63ec6 commit 8ebe7e6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

dev/tests/static/testsuite/Magento/Test/Integrity/Phrase/ArgumentsTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,15 @@ private function checkEmptyPhrases($phrase, &$missedPhraseErrors)
9898
private function checkArgumentMismatch($phrase, &$incorrectNumberOfArgumentsErrors)
9999
{
100100
if (preg_match_all('/%(\w+)/', $phrase['phrase'], $matches) || $phrase['arguments']) {
101-
$placeholderCount = count($matches[1]);
101+
$placeholderCount = count(array_unique($matches[1]));
102+
// count all occurrences of sprintf placeholders
103+
preg_match_all('/%\b([sducoxXbgGeEfF])\b/', $phrase['phrase'], $sprintfMatches);
104+
if (count($sprintfMatches[0]) > count(array_unique($sprintfMatches[0]))) {
105+
$placeholderCount = $placeholderCount + count($sprintfMatches[0]) - count(array_unique($sprintfMatches[0]));
106+
}
102107

103-
// Check for zend placeholders %placeholder% and sprintf placeholder %s
104-
if (preg_match_all('/%((s)|([A-Za-z]+)%)/', $phrase['phrase'], $placeHolders, PREG_OFFSET_CAPTURE)) {
108+
// Check for zend placeholders %placeholder% and sprintf placeholders
109+
if (preg_match_all('/%\b(([sducoxXbgGeEfF])\b|([A-Za-z]+)%)/', $phrase['phrase'], $placeHolders, PREG_OFFSET_CAPTURE)) {
105110
foreach ($placeHolders[0] as $ph) {
106111
// Check if char after placeholder is not a digit or letter
107112
$charAfterPh = $phrase['phrase'][$ph[1] + strlen($ph[0])];

0 commit comments

Comments
 (0)