Skip to content

Commit 9986002

Browse files
committed
Fixed some code style issues.
1 parent ecc2494 commit 9986002

File tree

3 files changed

+104
-14
lines changed

3 files changed

+104
-14
lines changed

src/Magento/AcceptanceTestFramework/Module/MagentoSequence.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
/**
88
* MagentoSequence module.
9+
*
10+
* @codingStandardsIgnoreFile
911
*/
1012
class MagentoSequence extends Sequence
1113
{

src/Magento/AcceptanceTestFramework/Util/TestGenerator.php

Lines changed: 90 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,11 @@ private function generateClassAnnotationsPhp($classAnnotationsObject)
217217
}
218218

219219
if ($annotationType == "title") {
220-
$classAnnotationsPhp .= sprintf(" * @Title(\"%s\")\n", ucwords($annotationType), $annotationName[0]);
220+
$classAnnotationsPhp .= sprintf(
221+
" * @Title(\"%s\")\n",
222+
ucwords($annotationType),
223+
$annotationName[0]
224+
);
221225
}
222226

223227
if ($annotationType == "description") {
@@ -381,14 +385,28 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
381385
break;
382386
case "clickWithLeftButton":
383387
if ($selector) {
384-
$testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y);
388+
$testSteps .= sprintf(
389+
"\t\t$%s->%s(%s, %s, %s);\n",
390+
$actor,
391+
$actionName,
392+
$selector,
393+
$x,
394+
$y
395+
);
385396
} else {
386397
$testSteps .= sprintf("\t\t$%s->%s(null, %s, %s);\n", $actor, $actionName, $x, $y);
387398
}
388399
break;
389400
case "clickWithRightButton":
390401
if ($selector) {
391-
$testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y);
402+
$testSteps .= sprintf(
403+
"\t\t$%s->%s(%s, %s, %s);\n",
404+
$actor,
405+
$actionName,
406+
$selector,
407+
$x,
408+
$y
409+
);
392410
} else {
393411
$testSteps .= sprintf("\t\t$%s->%s(null, %s, %s);\n", $actor, $actionName, $x, $y);
394412
}
@@ -454,7 +472,11 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
454472
}
455473
} else {
456474
if ($hookObject) {
457-
$testSteps .= sprintf("\t\t\$this->%s = new EntityApiHandler($%s);\n", $key, $entity);
475+
$testSteps .= sprintf(
476+
"\t\t\$this->%s = new EntityApiHandler($%s);\n",
477+
$key,
478+
$entity
479+
);
458480
$testSteps .= sprintf("\t\t\$this->%s->createEntity();\n", $key);
459481
} else {
460482
$testSteps .= sprintf("\t\t$%s = new EntityApiHandler($%s);\n", $key, $entity);
@@ -481,7 +503,13 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
481503
break;
482504
case "dontSeeCookie":
483505
if (isset($parameterArray)) {
484-
$testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $parameterArray);
506+
$testSteps .= sprintf(
507+
"\t\t$%s->%s(%s, %s);\n",
508+
$actor,
509+
$actionName,
510+
$input,
511+
$parameterArray
512+
);
485513
} else {
486514
$testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input);
487515
}
@@ -525,7 +553,13 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
525553
$testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input);
526554
break;
527555
case "dontSeeInFormFields":
528-
$testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray);
556+
$testSteps .= sprintf(
557+
"\t\t$%s->%s(%s, %s);\n",
558+
$actor,
559+
$actionName,
560+
$selector,
561+
$parameterArray
562+
);
529563
break;
530564
case "dontSeeInTitle":
531565
$testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input);
@@ -704,7 +738,14 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
704738
case "moveMouseOver":
705739
if ($selector) {
706740
if (isset($step['x']) || isset($step['y'])) {
707-
$testSteps .= sprintf("\t\t$%s->%s(%s, %s, %s);\n", $actor, $actionName, $selector, $x, $y);
741+
$testSteps .= sprintf(
742+
"\t\t$%s->%s(%s, %s, %s);\n",
743+
$actor,
744+
$actionName,
745+
$selector,
746+
$x,
747+
$y
748+
);
708749
} else {
709750
$testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $selector);
710751
}
@@ -743,7 +784,13 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
743784
break;
744785
case "resetCookie":
745786
if (isset($parameterArray)) {
746-
$testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $parameterArray);
787+
$testSteps .= sprintf(
788+
"\t\t$%s->%s(%s, %s);\n",
789+
$actor,
790+
$actionName,
791+
$input,
792+
$parameterArray
793+
);
747794
} else {
748795
$testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input);
749796
}
@@ -782,7 +829,13 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
782829
$customActionAttributes['parameterArray']
783830
);
784831
} else {
785-
$testSteps .= sprintf("\t\t$%s->%s(%s, [%s]);\n", $actor, $actionName, $selector, $input);
832+
$testSteps .= sprintf(
833+
"\t\t$%s->%s(%s, [%s]);\n",
834+
$actor,
835+
$actionName,
836+
$selector,
837+
$input
838+
);
786839
}
787840
break;
788841
case "see":
@@ -794,7 +847,13 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
794847
break;
795848
case "seeCookie":
796849
if (isset($parameterArray)) {
797-
$testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $input, $parameterArray);
850+
$testSteps .= sprintf(
851+
"\t\t$%s->%s(%s, %s);\n",
852+
$actor,
853+
$actionName,
854+
$input,
855+
$parameterArray
856+
);
798857
} else {
799858
$testSteps .= sprintf("\t\t$%s->%s(%s);\n", $actor, $actionName, $input);
800859
}
@@ -838,7 +897,13 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
838897
$testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $input);
839898
break;
840899
case "seeInFormFields":
841-
$testSteps .= sprintf("\t\t$%s->%s(%s, %s);\n", $actor, $actionName, $selector, $parameterArray);
900+
$testSteps .= sprintf(
901+
"\t\t$%s->%s(%s, %s);\n",
902+
$actor,
903+
$actionName,
904+
$selector,
905+
$parameterArray
906+
);
842907
break;
843908
case "seeInPageSource":
844909
// TODO: Solve the HTML parsing issue.
@@ -1076,7 +1141,12 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false)
10761141
$customActionAttributes['parameter']
10771142
);
10781143
} else {
1079-
$testSteps .= sprintf("\t\t$%s = $%s->%s();\n", $returnVariable, $actor, $actionName);
1144+
$testSteps .= sprintf(
1145+
"\t\t$%s = $%s->%s();\n",
1146+
$returnVariable,
1147+
$actor,
1148+
$actionName
1149+
);
10801150
}
10811151
}
10821152
} else {
@@ -1293,15 +1363,21 @@ private function generateTestAnnotationsPhp($testAnnotationsObject)
12931363
}
12941364

12951365
if ($annotationType == "severity") {
1296-
$testAnnotationsPhp .= sprintf("\t * @Severity(level = SeverityLevel::%s)\n", $annotationName[0]);
1366+
$testAnnotationsPhp .= sprintf(
1367+
"\t * @Severity(level = SeverityLevel::%s)\n",
1368+
$annotationName[0]
1369+
);
12971370
}
12981371

12991372
if ($annotationType == "testCaseId") {
13001373
$testAnnotationsPhp .= sprintf("\t * @TestCaseId(\"%s\")\n", $annotationName[0]);
13011374
}
13021375
}
13031376

1304-
$testAnnotationsPhp .= sprintf("\t * @Parameter(name = \"%s\", value=\"$%s\")\n", "AcceptanceTester", "I");
1377+
$testAnnotationsPhp .= sprintf(
1378+
"\t * @Parameter(name = \"%s\", value=\"$%s\")\n",
1379+
"AcceptanceTester", "I"
1380+
);
13051381

13061382
foreach ($testAnnotationsObject as $annotationType => $annotationName) {
13071383
if ($annotationType == "group") {

src/Magento/AcceptanceTestFramework/Util/msq.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
use Magento\AcceptanceTestFramework\Module\MagentoSequence;
33

44
if (!function_exists('msq')) {
5+
/**
6+
* Return unique sequence within test.
7+
*
8+
* @param null $id
9+
* @return string
10+
*/
511
function msq($id = null)
612
{
713
if ($id and isset(MagentoSequence::$hash[$id])) {
@@ -17,6 +23,12 @@ function msq($id = null)
1723
}
1824

1925
if (!function_exists('msqs')) {
26+
/**
27+
* Return unique sequence within suite.
28+
*
29+
* @param null $id
30+
* @return string
31+
*/
2032
function msqs($id = null)
2133
{
2234
if ($id and isset(MagentoSequence::$suiteHash[$id])) {

0 commit comments

Comments
 (0)