From 760573bf217b5bdaa6cc3bfa83d451cc4e63f5d5 Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Wed, 25 Oct 2017 08:50:48 -0500 Subject: [PATCH 01/23] MQE-456: persisted.data references break double quotes unnecessarily - Changed resolveTestVariable to process each arg individually, as opposed to the whole string. - fixed quote breaking issue. - consolidated and refactored code around persisted data replacement. --- .../Resources/PersistedReplacementCest.txt | 69 ++++++++++ .../Cest/persistedReplacementCest.xml | 62 +++++++++ .../Data/persistedReplacementData.xml | 20 +++ .../TestModule/Page/SamplePage.xml | 14 ++ .../TestModule/Section/SampleSection.xml | 17 +++ .../PersistedReplacementGenerationTest.php | 42 ++++++ .../Util/TestGenerator.php | 123 ++++++++++++------ 7 files changed, 306 insertions(+), 41 deletions(-) create mode 100644 dev/tests/verification/Resources/PersistedReplacementCest.txt create mode 100644 dev/tests/verification/TestModule/Cest/persistedReplacementCest.xml create mode 100644 dev/tests/verification/TestModule/Data/persistedReplacementData.xml create mode 100644 dev/tests/verification/TestModule/Page/SamplePage.xml create mode 100644 dev/tests/verification/TestModule/Section/SampleSection.xml create mode 100644 dev/tests/verification/Tests/PersistedReplacementGenerationTest.php diff --git a/dev/tests/verification/Resources/PersistedReplacementCest.txt b/dev/tests/verification/Resources/PersistedReplacementCest.txt new file mode 100644 index 000000000..2fb7f3e96 --- /dev/null +++ b/dev/tests/verification/Resources/PersistedReplacementCest.txt @@ -0,0 +1,69 @@ +amGoingTo("create entity that has the mergeKey: createData1"); + $replacementPerson = DataObjectHandler::getInstance()->getObject("replacementPerson"); + $this->createData1 = new DataPersistenceHandler($replacementPerson); + $this->createData1->createEntity(); + } + + /** + * @Parameter(name = "AcceptanceTester", value="$I") + * @param AcceptanceTester $I + * @return void + */ + public function PersistedReplacementTest(AcceptanceTester $I) + { + $I->amGoingTo("create entity that has the mergeKey: testScopeData"); + $replacementPerson = DataObjectHandler::getInstance()->getObject("replacementPerson"); + $testScopeData = new DataPersistenceHandler($replacementPerson); + $testScopeData->createEntity(); + $I->amGoingTo("create entity that has the mergeKey: uniqueData"); + $uniquePerson = DataObjectHandler::getInstance()->getObject("uniquePerson"); + $uniqueData = new DataPersistenceHandler($uniquePerson); + $uniqueData->createEntity(); + $I->amOnPage("/success/success2.html"); + $I->amOnPage($testScopeData->getCreatedDataByName('firstname') . ".html"); + $I->amOnPage($this->createData1->getCreatedDataByName('firstname') . ".html"); + $I->amOnPage("/" . $testScopeData->getCreatedDataByName('firstname') . "/" . $testScopeData->getCreatedDataByName('lastname') . ".html"); + $I->amOnPage("/" . $this->createData1->getCreatedDataByName('firstname') . "/" . $this->createData1->getCreatedDataByName('lastname') . ".html"); + $I->click("#element ." . $testScopeData->getCreatedDataByName('firstname')); + $I->click("#" . $testScopeData->getCreatedDataByName('firstname') . " .success"); + $I->click("#John-Doe ." . $testScopeData->getCreatedDataByName('lastname')); + $I->click("#" . $testScopeData->getCreatedDataByName('firstname') . " ." . $testScopeData->getCreatedDataByName('lastname')); + $I->click("#" . $this->createData1->getCreatedDataByName('firstname') . " ." . $this->createData1->getCreatedDataByName('lastname')); + $I->fillField("#sample", "Hello " . $testScopeData->getCreatedDataByName('firstname') . " " . $testScopeData->getCreatedDataByName('lastname')); + $I->fillField("#sample", "Hello " . $this->createData1->getCreatedDataByName('firstname') . " " . $this->createData1->getCreatedDataByName('lastname')); + $I->searchAndMultiSelectOption("#selector", [$testScopeData->getCreatedDataByName('lastname')]); + $I->searchAndMultiSelectOption("#selector", [$this->createData1->getCreatedDataByName('lastname')]); + $I->amOnPage($uniqueData->getCreatedDataByName('firstname') . ".html"); + $I->amOnPage("/" . $uniqueData->getCreatedDataByName('firstname') . "/" . $uniqueData->getCreatedDataByName('lastname') . ".html"); + $I->click("#element ." . $uniqueData->getCreatedDataByName('firstname')); + $I->click("#" . $uniqueData->getCreatedDataByName('firstname') . " .success"); + $I->click("#" . $uniqueData->getCreatedDataByName('firstname')); + } +} diff --git a/dev/tests/verification/TestModule/Cest/persistedReplacementCest.xml b/dev/tests/verification/TestModule/Cest/persistedReplacementCest.xml new file mode 100644 index 000000000..51dd768a9 --- /dev/null +++ b/dev/tests/verification/TestModule/Cest/persistedReplacementCest.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dev/tests/verification/TestModule/Data/persistedReplacementData.xml b/dev/tests/verification/TestModule/Data/persistedReplacementData.xml new file mode 100644 index 000000000..faec18687 --- /dev/null +++ b/dev/tests/verification/TestModule/Data/persistedReplacementData.xml @@ -0,0 +1,20 @@ + + + + + + + John + Doe + + + John + Doe + + diff --git a/dev/tests/verification/TestModule/Page/SamplePage.xml b/dev/tests/verification/TestModule/Page/SamplePage.xml new file mode 100644 index 000000000..034e0dd50 --- /dev/null +++ b/dev/tests/verification/TestModule/Page/SamplePage.xml @@ -0,0 +1,14 @@ + + + + + +
+ + diff --git a/dev/tests/verification/TestModule/Section/SampleSection.xml b/dev/tests/verification/TestModule/Section/SampleSection.xml new file mode 100644 index 000000000..789e8dfd3 --- /dev/null +++ b/dev/tests/verification/TestModule/Section/SampleSection.xml @@ -0,0 +1,17 @@ + + + + +
+ + + + +
+
diff --git a/dev/tests/verification/Tests/PersistedReplacementGenerationTest.php b/dev/tests/verification/Tests/PersistedReplacementGenerationTest.php new file mode 100644 index 000000000..ab74c7331 --- /dev/null +++ b/dev/tests/verification/Tests/PersistedReplacementGenerationTest.php @@ -0,0 +1,42 @@ +getObject(self::PERSISTED_REPLACEMENT_CEST); + $test = TestGenerator::getInstance(null, [$cest]); + $test->createAllCestFiles(); + + $cestFile = $test->getExportDir() . + DIRECTORY_SEPARATOR . + self::PERSISTED_REPLACEMENT_CEST . + ".php"; + + $this->assertTrue(file_exists($cestFile)); + + $fileDiffUtil = new FileDiffUtil( + self::RESOURCES_PATH . DIRECTORY_SEPARATOR . self::PERSISTED_REPLACEMENT_CEST . ".txt", + $cestFile + ); + + $diffResult = $fileDiffUtil->diffContents(); + $this->assertNull($diffResult, $diffResult); + } +} diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 86682fc2e..cb5e0e7dd 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -876,57 +876,102 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) } /** - * Resolves replacement of $input$ and $$input$$ in given string. - * Can be given a boolean to surround replacement with quote breaking. + * Resolves replacement of $input$ and $$input$$ in given function, recursing and replacing individual arguments + * Also determines if each argument requires any quote replacement. * @param string $inputString - * @param bool $quoteBreak + * @param array $args * @return string - * @throws \Exception */ - private function resolveTestVariable($inputString, $quoteBreak = false) + private function resolveTestVariable($inputString, $args) { $outputString = $inputString; - $replaced = false; - // Check for Cest-scope variables first, stricter regex match. - preg_match_all("/\\$\\$[\w.\[\]]+\\$\\$/", $outputString, $matches); - foreach ($matches[0] as $match) { - $replacement = null; - $variable = $this->stripAndSplitReference($match, '$$'); - if (count($variable) != 2) { - throw new \Exception( - "Invalid Persisted Entity Reference: " . $match . - ". Hook persisted entity references must follow \$\$entityMergeKey.field\$\$ format." - ); - } - $replacement = sprintf("\$this->%s->getCreatedDataByName('%s')", $variable[0], $variable[1]); - if ($quoteBreak) { - $replacement = '" . ' . $replacement . ' . "'; - } - $outputString = str_replace($match, $replacement, $outputString); - $replaced = true; + //Loop through each argument, replace and then replace + foreach ($args as $arg) { + $outputArg = $arg; + // Match on any $$data.key$$ found inside arg, matches[0] will be array of $$data.key$$ + preg_match_all("/\\$\\$[\w.\[\]]+\\$\\$/", $outputArg, $matches); + $this->replaceMatchesIntoArg($matches[0], $outputArg, "$$"); + + // Match on any $data.key$ found inside arg, matches[0] will be array of $data.key$ + preg_match_all("/\\$[\w.\[\]]+\\$/", $outputArg, $matches); + $this->replaceMatchesIntoArg($matches[0], $outputArg, "$"); + + $outputString = str_replace($arg, $outputArg, $outputString); } - // Check Test-scope variables - preg_match_all("/\\$[\w.\[\]]+\\$/", $outputString, $matches); - foreach ($matches[0] as $match) { + return $outputString; + } + + /** + * Replaces all matches into given outputArg with. Variable scope determined by delimiter given + * @param array $matches + * @param string &$outputArg + * @param string $delimiter + * @return void + * @throws \Exception + */ + private function replaceMatchesIntoArg($matches, &$outputArg, $delimiter) + { + foreach ($matches as $match) { $replacement = null; - $variable = $this->stripAndSplitReference($match, '$'); + $variable = $this->stripAndSplitReference($match, $delimiter); if (count($variable) != 2) { throw new \Exception( - "Invalid Persisted Entity Reference: " . $match . - ". Test persisted entity references must follow \$entityMergeKey.field\$ format." + "Invalid Persisted Entity Reference: {$match}. + Test persisted entity references must follow {$delimiter}entityMergeKey.field{$delimiter} format." ); } - $replacement = sprintf("$%s->getCreatedDataByName('%s')", $variable[0], $variable[1]); - if ($quoteBreak) { - $replacement = '" . ' . $replacement . ' . "'; + if ($delimiter == "$") { + $replacement = sprintf("$%s->getCreatedDataByName('%s')", $variable[0], $variable[1]); + } elseif ($delimiter == "$$") { + $replacement = sprintf("\$this->%s->getCreatedDataByName('%s')", $variable[0], $variable[1]); + } + + //Determine if quoteBreak check is necessary. Assume replacement is surrounded in quotes, then override + if (strpos($outputArg, "\"") !== false) { + $outputArg = $this->processQuoteBreaks($match, $outputArg, $replacement); + } else { + $outputArg = str_replace($match, $replacement, $outputArg); } - $outputString = str_replace($match, $replacement, $outputString); - $replaced = true; } + } - return $outputString; + /** + * Processes an argument for $data.key$ and determines if it needs quote breaks on either ends. + * Returns an output with quote breaks and replacement already done. + * @param string $match + * @param string $argument + * @param string $replacement + * @return string + */ + private function processQuoteBreaks($match, $argument, $replacement) + { + $outputArg = $argument; + $beforeIndex = strpos($outputArg, $match) - 1; + $afterIndex = $beforeIndex + strlen($match) + 1; + $quoteBefore = true; + $quoteAfter = true; + + // Prepare replacement with quote breaks if needed + if ($argument[$beforeIndex] != "\"") { + $replacement = '" . ' . $replacement; + $quoteBefore = false; + } + if ($argument[$afterIndex] != "\"") { + $replacement = $replacement . ' . "'; + $quoteAfter = false; + } + //Remove quotes at either end of argument if they aren't necessary. + if ($quoteBefore) { + $outputArg = substr($outputArg, 0, $beforeIndex) . substr($outputArg, $beforeIndex+1); + $afterIndex--; + } + if ($quoteAfter) { + $outputArg = substr($outputArg, 0, $afterIndex) . substr($outputArg, $afterIndex+1); + } + $outputArg = str_replace($match, $replacement, $outputArg); + return $outputArg; } /** @@ -1226,9 +1271,7 @@ private function wrapFunctionCall($actor, $action, ...$args) } $output .= ");\n"; - // TODO put in condiional to prevent unncessary quote break (i.e. there are no strings to be appended to - // variable call. - return $this->resolveTestVariable($output, true); + return $this->resolveTestVariable($output, $args); } /** @@ -1256,9 +1299,7 @@ private function wrapFunctionCallWithReturnValue($returnVariable, $actor, $actio } $output .= ");\n"; - // TODO put in condiional to prevent unncessary quote break (i.e. there are no strings to be appended to - // variable call. - return $output = $this->resolveTestVariable($output, true); + return $this->resolveTestVariable($output, $args); } // @codingStandardsIgnoreEnd } From 5b8c86b2202b629a4bf5b1c2bd95ed5a3e5722e2 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Fri, 27 Oct 2017 10:29:28 -0500 Subject: [PATCH 02/23] MQE-236: Add a comment method - Adding the "comment" method to the MagentoWebDriver/Test Schema file. - Adding the "comment" method to the di.xml so it can appear multiple times in a single . --- etc/di.xml | 12 ++++++------ .../Test/etc/testSchema.xsd | 12 ++++++++++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/etc/di.xml b/etc/di.xml index aa24e6e1c..4f6dfcbcc 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -208,7 +208,7 @@ createDataKey createDataKey createDataKey - mergeKey + mergeKey *Cest.xml Cest @@ -218,9 +218,9 @@ - mergeKey - mergeKey - mergeKey + mergeKey + mergeKey + mergeKey name name createDataKey @@ -284,7 +284,7 @@ name name - mergeKey + mergeKey *ActionGroup.xml ActionGroup @@ -294,7 +294,7 @@ - mergeKey + mergeKey name name diff --git a/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd b/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd index 3a31fe992..6ed56a238 100644 --- a/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd +++ b/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd @@ -91,6 +91,7 @@ + @@ -366,6 +367,17 @@ + + + + + + + + + + + From 2b759a8f1668214b8893b3ec46b6d63d32676953 Mon Sep 17 00:00:00 2001 From: John Stennett Date: Fri, 27 Oct 2017 10:37:51 -0500 Subject: [PATCH 03/23] MQE-450: Adding a "clearField" method. - Adding the "clearField" method to the MagentoWebDriver file. - Adding the "clearField" method to the Test Schema. - Adding the "clearField" method to the di.xml so it can be listed multiple times in a test. --- etc/di.xml | 12 ++++++------ .../Module/MagentoWebDriver.php | 15 +++++++++++++-- .../Test/etc/testSchema.xsd | 12 ++++++++++++ 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/etc/di.xml b/etc/di.xml index 4f6dfcbcc..ad5b0db84 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -208,7 +208,7 @@ createDataKey createDataKey createDataKey - mergeKey + mergeKey *Cest.xml Cest @@ -218,9 +218,9 @@ - mergeKey - mergeKey - mergeKey + mergeKey + mergeKey + mergeKey name name createDataKey @@ -284,7 +284,7 @@ name name - mergeKey + mergeKey *ActionGroup.xml ActionGroup @@ -294,7 +294,7 @@ - mergeKey + mergeKey name name diff --git a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php index 470db0c50..f2004b1ee 100644 --- a/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php +++ b/src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php @@ -235,7 +235,7 @@ public function formatMoney(float $money, $locale = 'en_US.UTF-8') /** * Parse float number with thousands_sep. * - * @param $floatString + * @param string $floatString * @return float */ public function parseFloat($floatString){ @@ -283,8 +283,9 @@ public function scrollToTopOfPage() * Conditional click for an area that should be visible * * @param string $selector - * @param string dependentSelector + * @param string $dependentSelector * @param bool $visible + * @throws \Exception */ public function conditionalClick($selector, $dependentSelector, $visible) { @@ -305,6 +306,16 @@ public function conditionalClick($selector, $dependentSelector, $visible) } } + /** + * Clear the given Text Field or Textarea + * + * @param string $selector + */ + public function clearField($selector) + { + $this->fillField($selector, ""); + } + /** * Override for _failed method in Codeception method. Adds png and html attachments to allure report * following parent execution of test failure processing. diff --git a/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd b/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd index 6ed56a238..d6cd059b3 100644 --- a/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd +++ b/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd @@ -86,6 +86,7 @@ + @@ -305,6 +306,17 @@ + + + + + + + + + + + From 9ca4270a9275ddcae3578b1cf697f43432d5b9e7 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Wed, 25 Oct 2017 14:01:00 -0500 Subject: [PATCH 04/23] MQE-465: Data object xml support multidimensional arrays. --- .../Persist/DataPersistenceHandler.php | 2 +- .../Persist/OperationDataArrayResolver.php | 45 +++++++++++++++---- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/DataPersistenceHandler.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/DataPersistenceHandler.php index fe1b1e037..d69595f7c 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/DataPersistenceHandler.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/DataPersistenceHandler.php @@ -174,7 +174,7 @@ private function setCreatedObject($response, $index, $requestDataArray, $isJson) $responseData = $responseData[$index]; } if (is_array($responseData)) { - $persistedData = array_merge($requestDataArray, $responseData); + $persistedData = $this->convertToFlatArray(array_merge($requestDataArray, $responseData)); } else { $persistedData = $requestDataArray; } diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php index 852862640..e9184d015 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php @@ -61,10 +61,11 @@ public function __construct($dependentEntities = null) * @param EntityDataObject $entityObject * @param array $operationMetadata * @param string $operation + * @param integer $depth * @return array * @throws \Exception */ - public function resolveOperationDataArray($entityObject, $operationMetadata, $operation) + public function resolveOperationDataArray($entityObject, $operationMetadata, $operation, $depth = 0) { $operationDataArray = []; self::incrementSequence($entityObject->getName()); @@ -72,8 +73,27 @@ public function resolveOperationDataArray($entityObject, $operationMetadata, $op foreach ($operationMetadata as $operationElement) { if ($operationElement->getType() == OperationElementExtractor::OPERATION_OBJECT_OBJ_NAME) { $entityObj = $this->resolveOperationObjectAndEntityData($entityObject, $operationElement->getValue()); - $operationDataArray[$operationElement->getKey()] = - $this->resolveOperationDataArray($entityObj, $operationElement->getNestedMetadata(), $operation); + if (null === $entityObj && $operationElement->getRequired()) { + throw new \Exception(sprintf( + self::EXCEPTION_REQUIRED_DATA, + $operationElement->getType(), + $operationElement->getKey(), + $entityObject->getName() + )); + } elseif (null === $entityObj) { + continue; + } + $operationData = $this->resolveOperationDataArray( + $entityObj, + $operationElement->getNestedMetadata(), + $operation, + $depth+1 + ); + if ($depth == 0) { + $operationDataArray[$operationElement->getKey()] = $operationData; + } else { + $operationDataArray = $operationData; + } continue; } @@ -127,7 +147,8 @@ public function resolveOperationDataArray($entityObject, $operationMetadata, $op $operationDataSubArray = $this->resolveNonPrimitiveElement( $entityName, $operationElement, - $operation + $operation, + $depth ); if ($operationElement->getType() == OperationDefinitionObjectHandler::ENTITY_OPERATION_ARRAY) { @@ -216,8 +237,12 @@ private function resolveOperationObjectAndEntityData($entityObject, $operationEl { if ($operationElementValue != $entityObject->getType()) { // if we have a mismatch attempt to retrieve linked data and return just the first linkage - $linkName = $entityObject->getLinkedEntitiesOfType($operationElementValue)[0]; - return DataObjectHandler::getInstance()->getObject($linkName); + $linkName = $entityObject->getLinkedEntitiesOfType($operationElementValue); + if (!empty($linkName)) { + $linkName = $linkName[0]; + return DataObjectHandler::getInstance()->getObject($linkName); + } + return null; } return $entityObject; @@ -229,9 +254,10 @@ private function resolveOperationObjectAndEntityData($entityObject, $operationEl * @param string $entityName * @param OperationElement $operationElement * @param string $operation + * @param integer $depth * @return array */ - private function resolveNonPrimitiveElement($entityName, $operationElement, $operation) + private function resolveNonPrimitiveElement($entityName, $operationElement, $operation, $depth) { $linkedEntityObj = $this->resolveLinkedEntityObject($entityName); @@ -242,10 +268,11 @@ private function resolveNonPrimitiveElement($entityName, $operationElement, $ope $operationSubArray = $this->resolveOperationDataArray( $linkedEntityObj, [$operationElement->getNestedOperationElement($operationElement->getValue())], - $operation + $operation, + $depth+1 ); - return $operationSubArray[$operationElement->getValue()]; + return $operationSubArray; } $operationMetadata = OperationDefinitionObjectHandler::getInstance()->getOperationDefinition( From 7656a873d2717c35fbcf424dd5d7cbccce26be31 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Mon, 30 Oct 2017 14:39:38 -0500 Subject: [PATCH 05/23] MQE-398: Rename Page.urlPath attribute --- .../verification/TestModule/Page/SamplePage.xml | 4 ++-- .../Page/Handlers/PageObjectHandler.php | 14 +++++++------- .../Page/Objects/PageObject.php | 6 +++--- .../Page/etc/PageObject.xsd | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dev/tests/verification/TestModule/Page/SamplePage.xml b/dev/tests/verification/TestModule/Page/SamplePage.xml index 034e0dd50..02eca33c9 100644 --- a/dev/tests/verification/TestModule/Page/SamplePage.xml +++ b/dev/tests/verification/TestModule/Page/SamplePage.xml @@ -7,8 +7,8 @@ --> - + xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd"> +
diff --git a/src/Magento/FunctionalTestingFramework/Page/Handlers/PageObjectHandler.php b/src/Magento/FunctionalTestingFramework/Page/Handlers/PageObjectHandler.php index b13ae5c7b..928911150 100644 --- a/src/Magento/FunctionalTestingFramework/Page/Handlers/PageObjectHandler.php +++ b/src/Magento/FunctionalTestingFramework/Page/Handlers/PageObjectHandler.php @@ -18,8 +18,8 @@ class PageObjectHandler implements ObjectHandlerInterface { const TYPE = 'page'; const SUB_TYPE = 'section'; - const URL_PATH_ATTR = 'urlPath'; - const MODULE_ATTR = 'module'; + const URL = 'url'; + const MODULE = 'module'; const PARAMETERIZED = 'parameterized'; /** @@ -102,12 +102,12 @@ private function initPageObjects() } foreach ($parsedObjs as $pageName => $pageData) { - $urlPath = $pageData[PageObjectHandler::URL_PATH_ATTR]; - $module = $pageData[PageObjectHandler::MODULE_ATTR]; - $sections = array_keys($pageData[PageObjectHandler::SUB_TYPE]); - $parameterized = $pageData[PageObjectHandler::PARAMETERIZED] ?? false; + $url = $pageData[self::URL]; + $module = $pageData[self::MODULE]; + $sections = array_keys($pageData[self::SUB_TYPE]); + $parameterized = $pageData[self::PARAMETERIZED] ?? false; - $this->pages[$pageName] = new PageObject($pageName, $urlPath, $module, $sections, $parameterized); + $this->pages[$pageName] = new PageObject($pageName, $url, $module, $sections, $parameterized); } } } diff --git a/src/Magento/FunctionalTestingFramework/Page/Objects/PageObject.php b/src/Magento/FunctionalTestingFramework/Page/Objects/PageObject.php index 7a08b2714..79bfbcd58 100644 --- a/src/Magento/FunctionalTestingFramework/Page/Objects/PageObject.php +++ b/src/Magento/FunctionalTestingFramework/Page/Objects/PageObject.php @@ -52,15 +52,15 @@ class PageObject /** * PageObject constructor. * @param string $name - * @param string $urlPath + * @param string $url * @param string $module * @param array $sections * @param bool $parameterized */ - public function __construct($name, $urlPath, $module, $sections, $parameterized) + public function __construct($name, $url, $module, $sections, $parameterized) { $this->name = $name; - $this->url = $urlPath; + $this->url = $url; $this->module = $module; $this->sectionNames = $sections; $this->parameterized = $parameterized; diff --git a/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd b/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd index 631b40531..b862cd364 100644 --- a/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd +++ b/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd @@ -48,10 +48,10 @@ - + - Url path (excluding the base url) for the page. Use "%s" for placeholders for variables. + URL for the page. Do not include the hostname. For example: "/admin/customer/index/" From ec05ce871c3852bb185ba1e848871add81521566 Mon Sep 17 00:00:00 2001 From: Ian Meron Date: Tue, 31 Oct 2017 09:51:38 -0500 Subject: [PATCH 06/23] MQE-388: Write store settings before tests - change output deletion behavior - fix codesniffer method - add new metadata generator util - add new example input file - change dir setup util to exposer public recursive delete --- .../Util/Filesystem/DirSetupUtil.php | 2 +- .../MetadataGenerator/MetadataGenUtil.php | 179 ++++++++++++++++++ .../_generateMetadtataFile.php | 23 +++ .../Util/MetadataGenerator/input.yml.sample | 4 + .../views/operation.mustache | 13 ++ .../views/partials/field.mustache | 1 + .../views/partials/object.mustache | 10 + 7 files changed, 231 insertions(+), 1 deletion(-) create mode 100644 src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/MetadataGenUtil.php create mode 100644 src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/_generateMetadtataFile.php create mode 100644 src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/input.yml.sample create mode 100644 src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/views/operation.mustache create mode 100644 src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/views/partials/field.mustache create mode 100644 src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/views/partials/object.mustache diff --git a/src/Magento/FunctionalTestingFramework/Util/Filesystem/DirSetupUtil.php b/src/Magento/FunctionalTestingFramework/Util/Filesystem/DirSetupUtil.php index 405b2a4f7..32c03966e 100644 --- a/src/Magento/FunctionalTestingFramework/Util/Filesystem/DirSetupUtil.php +++ b/src/Magento/FunctionalTestingFramework/Util/Filesystem/DirSetupUtil.php @@ -32,7 +32,7 @@ public static function createGroupDir($fullPath) * @param string $directory * @return void */ - private static function rmdirRecursive($directory) + public static function rmdirRecursive($directory) { $it = new RecursiveDirectoryIterator($directory, FilesystemIterator::SKIP_DOTS); diff --git a/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/MetadataGenUtil.php b/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/MetadataGenUtil.php new file mode 100644 index 000000000..2015a2554 --- /dev/null +++ b/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/MetadataGenUtil.php @@ -0,0 +1,179 @@ +operationName = $operationName; + $this->operationDataType = $operationDataType; + $this->operationUrl = $operationUrl; + $this->inputString = $inputString; + + $this->filepath = self::OUTPUT_DIR . DIRECTORY_SEPARATOR . $this->operationDataType . "-meta.xml"; + } + + /** + * Function which takes params from constructor, transforms into data array and outputs a representative metadata + * file for MFTF to consume and send requests. + * + * @return void + */ + public function generateMetadataFile() + { + $this->initMustacheTemplates(); + + // parse the string params into an array + parse_str($this->inputString, $results); + $data = $this->convertResultToEntry($results, $this->operationDataType); + $data = $this->appendParentParams($data); + $output = $this->mustache_engine->render('operation', $data); + $this->cleanAndCreateOutputDir(); + file_put_contents( + $this->filepath, + $output + ); + } + + /** + * Function which initializes mustache templates for file generation. + * + * @return void + */ + private function initMustacheTemplates() + { + $this->mustache_engine = new Mustache_Engine( + ['loader' => new Mustache_Loader_FilesystemLoader("views"), + 'partials_loader' => new Mustache_Loader_FilesystemLoader( + "views" . DIRECTORY_SEPARATOR . "partials" + )] + ); + } + + /** + * Function which takes the top level params from the user and returns an array appended with the needed config. + * + * @param array $data + * @return array + */ + private function appendParentParams($data) + { + $result = $data; + $result['operationName'] = $this->operationName; + $result['operationDataType'] = $this->operationDataType; + $result['operationUrl'] = $this->operationUrl; + + return $result; + } + + /** + * Function which is called recursively to generate the mustache array for the template enging. Makes decisions + * about type and format based on parameter array. + * + * @param array $results + * @param string $defaultDataType + * @return array + */ + private function convertResultToEntry($results, $defaultDataType) + { + $data = []; + + foreach ($results as $key => $result) { + $entry = []; + if (is_array($result)) { + $entry = array_merge($entry, ['objectName' => $key]); + $res = $this->convertResultToEntry($result, $defaultDataType); + if (!array_key_exists('objects', $res)) { + $entry = array_merge($entry, ['objects' => null]); + $entry = array_merge($entry, ['dataType' => $key]); + } else { + $entry = array_merge($entry, ['hasChildObj' => true]); + $entry = array_merge($entry, ['dataType' => $defaultDataType]); + } + $data['objects'][] = array_merge($entry, $res); + } else { + $data['fields'][] = ['fieldName' => $key]; + } + } + + return $data; + } + + /** + * Function which cleans any previously created fileand creates the _output dir. + * + * @return void + */ + private function cleanAndCreateOutputDir() + { + if (!file_exists(self::OUTPUT_DIR)) { + mkdir(self::OUTPUT_DIR); + } + + if (file_exists($this->filepath)) { + unlink($this->filepath); + } + } +} diff --git a/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/_generateMetadtataFile.php b/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/_generateMetadtataFile.php new file mode 100644 index 000000000..25aa7ee19 --- /dev/null +++ b/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/_generateMetadtataFile.php @@ -0,0 +1,23 @@ +generateMetadataFile(); diff --git a/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/input.yml.sample b/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/input.yml.sample new file mode 100644 index 000000000..503aef067 --- /dev/null +++ b/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/input.yml.sample @@ -0,0 +1,4 @@ +operationName: createMyEntity +operationDataType: myEntityType +operationUrl: /admin/system_config/save/someEntity +inputString: entity[param1]=value1&entity[param2]=value2&entity[param3]=value3&entityField=field1 diff --git a/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/views/operation.mustache b/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/views/operation.mustache new file mode 100644 index 000000000..f3ba9ddfe --- /dev/null +++ b/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/views/operation.mustache @@ -0,0 +1,13 @@ + + + + + + {{>object}} + + \ No newline at end of file diff --git a/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/views/partials/field.mustache b/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/views/partials/field.mustache new file mode 100644 index 000000000..284835ef2 --- /dev/null +++ b/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/views/partials/field.mustache @@ -0,0 +1 @@ +string diff --git a/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/views/partials/object.mustache b/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/views/partials/object.mustache new file mode 100644 index 000000000..2e7210a8f --- /dev/null +++ b/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/views/partials/object.mustache @@ -0,0 +1,10 @@ +{{#objects}} + +{{#fields}} + {{> field}} +{{/fields}} +{{#hasChildObj}} + {{> object}} +{{/hasChildObj}} + +{{/objects}} \ No newline at end of file From 4f5ab04b2e85e4b4e69bbc43a63dd27ee48ca50e Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Tue, 31 Oct 2017 10:50:40 -0500 Subject: [PATCH 07/23] MQE-435: Create new jenkins build in test instance to run new framework tests --- bin/all-checks | 5 +++++ bin/phpunit-checks | 8 ++++++++ bin/static-checks | 11 +++++++++++ 3 files changed, 24 insertions(+) create mode 100755 bin/all-checks create mode 100755 bin/phpunit-checks create mode 100755 bin/static-checks diff --git a/bin/all-checks b/bin/all-checks new file mode 100755 index 000000000..d9dc95cda --- /dev/null +++ b/bin/all-checks @@ -0,0 +1,5 @@ +# Copyright © Magento, Inc. All rights reserved. +# See COPYING.txt for license details. + +bin/static-checks +bin/phpunit-checks diff --git a/bin/phpunit-checks b/bin/phpunit-checks new file mode 100755 index 000000000..a35595834 --- /dev/null +++ b/bin/phpunit-checks @@ -0,0 +1,8 @@ +# Copyright © Magento, Inc. All rights reserved. +# See COPYING.txt for license details. + +echo "===============================UNIT TESTS===============================" +vendor/bin/phpunit --configuration dev/tests/phpunit.xml --testsuite unit + +echo "===============================VERIFICATION TESTS===============================" +vendor/bin/phpunit --configuration dev/tests/phpunit.xml --testsuite verification diff --git a/bin/static-checks b/bin/static-checks new file mode 100755 index 000000000..e1ddd268a --- /dev/null +++ b/bin/static-checks @@ -0,0 +1,11 @@ +# Copyright © Magento, Inc. All rights reserved. +# See COPYING.txt for license details. + +echo "===============================PHP CODE SNIFFER REPORT===============================" +vendor/bin/phpcs ./src --standard=./dev/tests/static/Magento + +echo "===============================COPY PASTE DETECTOR REPORT===============================" +vendor/bin/phpcpd ./src + +echo "===============================MAGENTO COPYRIGHT REPORT===============================" +bin/copyright-check From aef9e31939942d6157efdef76c87745c9ba4b9f4 Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Tue, 31 Oct 2017 13:31:24 -0500 Subject: [PATCH 08/23] MQE-484: parameter array with data replacement does not generate uniqueness function correctly (#25) - ParameterArray now correctly replaces "{{data.key}}" uniqueness. - Verification test creation - add support for consistent array declaration - change functionality for pressKey - add exception for improperly formatted parameter array --- .../Resources/BasicFunctionalCest.txt | 5 +- .../Resources/ParameterArrayCest.txt | 42 ++++++++++ .../TestModule/Cest/ParameterArrayCest.xml | 25 ++++++ .../TestModule/Cest/basicFunctionalCest.xml | 5 +- .../TestModule/Data/ParameterArrayData.xml | 16 ++++ .../verification/Tests/ParameterArrayTest.php | 42 ++++++++++ .../Util/TestGenerator.php | 80 ++++++++++++++++++- 7 files changed, 211 insertions(+), 4 deletions(-) create mode 100644 dev/tests/verification/Resources/ParameterArrayCest.txt create mode 100644 dev/tests/verification/TestModule/Cest/ParameterArrayCest.xml create mode 100644 dev/tests/verification/TestModule/Data/ParameterArrayData.xml create mode 100644 dev/tests/verification/Tests/ParameterArrayTest.php diff --git a/dev/tests/verification/Resources/BasicFunctionalCest.txt b/dev/tests/verification/Resources/BasicFunctionalCest.txt index f17e73e1e..94bba2310 100644 --- a/dev/tests/verification/Resources/BasicFunctionalCest.txt +++ b/dev/tests/verification/Resources/BasicFunctionalCest.txt @@ -89,7 +89,10 @@ class BasicFunctionalCest $I->moveMouseOver(".functionalTestSelector"); $I->openNewTab(); $I->pauseExecution(); - $I->pressKey(".functionalTestSelector"); + $I->pressKey("#page", "a"); + $I->pressKey("#page", ['ctrl','a'],'new'); + $I->pressKey("#page", ['shift','111'],'1','x'); + $I->pressKey("#page", ['ctrl', 'a'],\Facebook\WebDriver\WebDriverKeys::DELETE); $I->reloadPage(); $I->resetCookie("cookieInput"); $I->resizeWindow(0, 0); diff --git a/dev/tests/verification/Resources/ParameterArrayCest.txt b/dev/tests/verification/Resources/ParameterArrayCest.txt new file mode 100644 index 000000000..8011e76b3 --- /dev/null +++ b/dev/tests/verification/Resources/ParameterArrayCest.txt @@ -0,0 +1,42 @@ +amGoingTo("create entity that has the mergeKey: simpleDataKey"); + $simpleParamData = DataObjectHandler::getInstance()->getObject("simpleParamData"); + $simpleDataKey = new DataPersistenceHandler($simpleParamData); + $simpleDataKey->createEntity(); + $I->searchAndMultiSelectOption("#selector", ["name"]); + $I->searchAndMultiSelectOption("#selector", [msq("simpleParamData")."prename"]); + $I->searchAndMultiSelectOption("#selector", ["postname".msq("simpleParamData")]); + $I->searchAndMultiSelectOption("#selector", [$simpleDataKey->getCreatedDataByName('name')]); + $I->searchAndMultiSelectOption("#selector", ["name", $simpleDataKey->getCreatedDataByName('name')]); + $I->searchAndMultiSelectOption("#selector", ['someKey' => $simpleDataKey->getCreatedDataByName('name')]); + $I->searchAndMultiSelectOption("#selector", ['someKey' => "name"]); + $I->searchAndMultiSelectOption("#selector", ['someKey' => msq("simpleParamData")."prename"]); + $I->searchAndMultiSelectOption("#selector", ['someKey' => "postname".msq("simpleParamData")]); + } +} diff --git a/dev/tests/verification/TestModule/Cest/ParameterArrayCest.xml b/dev/tests/verification/TestModule/Cest/ParameterArrayCest.xml new file mode 100644 index 000000000..8bd88fdd7 --- /dev/null +++ b/dev/tests/verification/TestModule/Cest/ParameterArrayCest.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + diff --git a/dev/tests/verification/TestModule/Cest/basicFunctionalCest.xml b/dev/tests/verification/TestModule/Cest/basicFunctionalCest.xml index 33036f3eb..28578bd44 100644 --- a/dev/tests/verification/TestModule/Cest/basicFunctionalCest.xml +++ b/dev/tests/verification/TestModule/Cest/basicFunctionalCest.xml @@ -74,7 +74,10 @@ - + + + + diff --git a/dev/tests/verification/TestModule/Data/ParameterArrayData.xml b/dev/tests/verification/TestModule/Data/ParameterArrayData.xml new file mode 100644 index 000000000..45b0c96d2 --- /dev/null +++ b/dev/tests/verification/TestModule/Data/ParameterArrayData.xml @@ -0,0 +1,16 @@ + + + + + + name + prename + postname + + diff --git a/dev/tests/verification/Tests/ParameterArrayTest.php b/dev/tests/verification/Tests/ParameterArrayTest.php new file mode 100644 index 000000000..1d9010c3d --- /dev/null +++ b/dev/tests/verification/Tests/ParameterArrayTest.php @@ -0,0 +1,42 @@ +getObject(self::PARAMETER_ARRAY_CEST); + $test = TestGenerator::getInstance(null, [$cest]); + $test->createAllCestFiles(); + + $cestFile = $test->getExportDir() . + DIRECTORY_SEPARATOR . + self::PARAMETER_ARRAY_CEST . + ".php"; + + $this->assertTrue(file_exists($cestFile)); + + $fileDiffUtil = new FileDiffUtil( + self::RESOURCES_PATH . DIRECTORY_SEPARATOR . self::PARAMETER_ARRAY_CEST . ".txt", + $cestFile + ); + + $diffResult = $fileDiffUtil->diffContents(); + $this->assertNull($diffResult, $diffResult); + } +} diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index f1c2b630a..69d88ddc7 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -376,8 +376,13 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) $time = $customActionAttributes['timeout']; } - if (isset($customActionAttributes['parameterArray'])) { - $parameterArray = $customActionAttributes['parameterArray']; + if (isset($customActionAttributes['parameterArray']) && $actionName != 'pressKey') { + // validate the param array is in the correct format + $this->validateParameterArray($customActionAttributes['parameterArray']); + + $parameterArray = "[" . $this->addUniquenessToParamArray( + $customActionAttributes['parameterArray'] + ) . "]"; } if (isset($customActionAttributes['requiredAction'])) { @@ -721,6 +726,29 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) $testSteps .= $this->wrapFunctionCall($actor, $actionName, $selector, $parameterArray); break; case "pressKey": + $parameterArray = $customActionAttributes['parameterArray'] ?? null; + if ($parameterArray) { + // validate the param array is in the correct format + $this->validateParameterArray($parameterArray); + + // trim off the outer braces and add commas for the regex match + $params = "," . substr($parameterArray, 1, strlen($parameterArray) - 2) . ","; + + // we are matching any nested arrays for a simultaneous press, any string literals, and any + // explicit function calls from a class. + preg_match_all('/(\[.*?\])|(\'.*?\')|(\\\\.*?\,)/', $params, $paramInput); + + //clean up the input by trimming any extra commas + $tmpParameterArray = []; + foreach ($paramInput[0] as $params) { + $tmpParameterArray[] = trim($params, ","); + } + + // put the array together as a string to be passed as args + $parameterArray = implode(",", $tmpParameterArray); + } + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $selector, $input, $parameterArray); + break; case "selectOption": $testSteps .= $this->wrapFunctionCall($actor, $actionName, $selector, $input, $parameterArray); break; @@ -1168,6 +1196,40 @@ private function generateTestsPhp($testsObject) return $testPhp; } + /** + * Detects uniqueness function calls on given attribute, and calls addUniquenessFunctionCall on matches. + * @param string $input + * @return string + */ + private function addUniquenessToParamArray($input) + { + $tempInput = trim($input, "[]"); + $paramArray = explode(",", $tempInput); + $result = []; + + foreach ($paramArray as $param) { + // Determine if param has key/value array notation + if (preg_match_all('/(.+)=>(.+)/', trim($param), $paramMatches)) { + $param1 = $this->addUniquenessToParamArray($paramMatches[1][0]); + $param2 = $this->addUniquenessToParamArray($paramMatches[2][0]); + $result[] = trim($param1) . " => " . trim($param2); + continue; + } + + // Matches strings wrapped in ', we assume these are string literals + if (preg_match('/^(["\']).*\1$/m', trim($param))) { + $result[] = $param; + continue; + } + + $replacement = $this->addUniquenessFunctionCall(trim($param)); + + $result[] = $replacement; + } + + return implode(", ", $result); + } + /** * Add uniqueness function call to input string based on regex pattern. * @@ -1302,4 +1364,18 @@ private function wrapFunctionCallWithReturnValue($returnVariable, $actor, $actio return $this->resolveTestVariable($output, $args); } // @codingStandardsIgnoreEnd + + /** + * Validates parameter array format, making sure user has enclosed string with square brackets. + * + * @param string $paramArray + * @return void + * @throws TestReferenceException + */ + private function validateParameterArray($paramArray) + { + if (substr($paramArray, 0, 1) != "[" || substr($paramArray, strlen($paramArray)-1, 1)!= "]") { + throw new TestReferenceException("parameterArray must begin with `[` and end with `]"); + } + } } From f371c4dff2a59b82a4bc9350666443bb55c691ee Mon Sep 17 00:00:00 2001 From: Ian Meron Date: Tue, 31 Oct 2017 13:37:44 -0500 Subject: [PATCH 09/23] MQE-506: Entity data cannot represent empty strings - add support for unspecified data values in entities --- .../DataGenerator/Handlers/DataObjectHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/DataObjectHandler.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/DataObjectHandler.php index 6f3987559..0ca3d459a 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/DataObjectHandler.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/DataObjectHandler.php @@ -174,7 +174,7 @@ private function parseDataEntities() if (array_key_exists(self::DATA_VALUES, $entity)) { foreach ($entity[self::DATA_VALUES] as $dataElement) { $dataElementKey = strtolower($dataElement[self::DATA_ELEMENT_KEY]); - $dataElementValue = $dataElement[self::DATA_ELEMENT_VALUE]; + $dataElementValue = $dataElement[self::DATA_ELEMENT_VALUE] ?? ""; if (array_key_exists(self::DATA_ELEMENT_UNIQUENESS_ATTR, $dataElement)) { $uniquenessValues[$dataElementKey] = $dataElement[self::DATA_ELEMENT_UNIQUENESS_ATTR]; } From 0fe9abcd0184007fffcb0f85ac86257ae3d70e8b Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Wed, 1 Nov 2017 11:48:25 -0500 Subject: [PATCH 10/23] MQE-477: Generate tests throws warning when using action groups in merged tests. - Changed setter of argData[argument] to not error on null arguments. --- .../Test/Util/ActionObjectExtractor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php b/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php index 4f75f5db8..b137102e4 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php @@ -107,7 +107,7 @@ private function processActionGroupArgs($actionAttributeData) } $actionAttributeArgData[self::ACTION_GROUP_ARGUMENTS][$attributeDataKey] = - $attributeDataValues[self::ACTION_GROUP_ARG_VALUE]; + $attributeDataValues[self::ACTION_GROUP_ARG_VALUE] ?? null; } return $actionAttributeArgData; From afe90836541c7b78443649d7ae56f1c0398609aa Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Wed, 1 Nov 2017 17:21:32 -0500 Subject: [PATCH 11/23] MQE-510: Output from robo generate:tests contains --env chrome parameters --- .../Resources/testSuiteGeneration1.txt | 8 ++--- .../Util/TestGenerator.php | 5 ++- .../Util/TestManifest.php | 32 ++----------------- 3 files changed, 9 insertions(+), 36 deletions(-) diff --git a/dev/tests/verification/Resources/testSuiteGeneration1.txt b/dev/tests/verification/Resources/testSuiteGeneration1.txt index 797b3c2a1..7b2da7836 100644 --- a/dev/tests/verification/Resources/testSuiteGeneration1.txt +++ b/dev/tests/verification/Resources/testSuiteGeneration1.txt @@ -1,4 +1,4 @@ -dev/tests/verification/_generated/functionalSuite1/sampleSuite3Cest.php:includeTest --env chrome -dev/tests/verification/_generated/functionalSuite1/sampleSuite5Cest.php:additionalTest --env chrome -dev/tests/verification/_generated/functionalSuite1/sampleSuiteCest.php:includeTest --env chrome -dev/tests/verification/_generated/functionalSuite1/sampleSuite4Cest.php:includeTest --env chrome +dev/tests/verification/_generated/functionalSuite1/sampleSuite3Cest.php:includeTest +dev/tests/verification/_generated/functionalSuite1/sampleSuite5Cest.php:additionalTest +dev/tests/verification/_generated/functionalSuite1/sampleSuiteCest.php:includeTest +dev/tests/verification/_generated/functionalSuite1/sampleSuite4Cest.php:includeTest diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index f1c2b630a..aa2c3ce91 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -121,15 +121,14 @@ private function createCestFile($cestPhp, $filename) * to the createCestFile function. * * @param string $runConfig - * @param string $env * @return void */ - public function createAllCestFiles($runConfig = null, $env = null) + public function createAllCestFiles($runConfig = null) { DirSetupUtil::createGroupDir($this->exportDirectory); // create our manifest file here - $testManifest = new TestManifest($this->exportDirectory, $runConfig, $env); + $testManifest = new TestManifest($this->exportDirectory, $runConfig); $cestPhpArray = $this->assembleAllCestPhp($testManifest); foreach ($cestPhpArray as $cestPhpFile) { diff --git a/src/Magento/FunctionalTestingFramework/Util/TestManifest.php b/src/Magento/FunctionalTestingFramework/Util/TestManifest.php index 4991a6644..216c42011 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestManifest.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestManifest.php @@ -11,7 +11,6 @@ class TestManifest { const SINGLE_RUN_CONFIG = 'singleRun'; - const DEFAULT_BROWSER = 'chrome'; const TEST_MANIFEST_FILENAME = 'testManifest.txt'; /** @@ -21,13 +20,6 @@ class TestManifest */ private $filePath; - /** - * Test Manifest environment flag. This is added to each dir or file in order for tests to execute properly. - * - * @var string $environment - */ - private $environment = self::DEFAULT_BROWSER; - /** * Type of manifest to generate. (Currently describes whether to path to a dir or for each test). * @@ -47,9 +39,8 @@ class TestManifest * * @param string $path * @param string $runConfig - * @param string $env */ - public function __construct($path, $runConfig, $env) + public function __construct($path, $runConfig) { $this->relativeDirPath = substr($path, strlen(dirname(dirname(TESTS_BP))) + 1); $filePath = $path . DIRECTORY_SEPARATOR . self::TEST_MANIFEST_FILENAME; @@ -58,10 +49,6 @@ public function __construct($path, $runConfig, $env) fclose($fileResource); $this->runTypeConfig = $runConfig; - - if ($env) { - $this->environment = $env; - } } /** @@ -87,7 +74,7 @@ public function recordCest($cestName, $tests) foreach ($tests as $test) { $line = $this->relativeDirPath . DIRECTORY_SEPARATOR . $cestName . '.php:' . $test->getName(); - fwrite($fileResource, $this->appendDefaultBrowser($line) ."\n"); + fwrite($fileResource, $line . "\n"); } fclose($fileResource); @@ -102,21 +89,8 @@ public function recordCest($cestName, $tests) public function recordPathToExportDir() { $fileResource = fopen($this->filePath, 'a'); - $line = $this->relativeDirPath . DIRECTORY_SEPARATOR; - fwrite($fileResource, $this->appendDefaultBrowser($line) ."\n"); - + fwrite($fileResource, $line . "\n"); fclose($fileResource); } - - /** - * Function which appends the --env flag to the test. This is needed to properly execute all tests in codeception. - * - * @param string $line - * @return string - */ - private function appendDefaultBrowser($line) - { - return "${line} --env " . $this->environment; - } } From e5e87443c2797eaa5872c4be58f7814e516431e6 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Thu, 2 Nov 2017 08:51:12 -0500 Subject: [PATCH 12/23] MQE-510: Output from robo generate:tests contains --env chrome parameters - Use PHP_EOL instead of '\n' --- src/Magento/FunctionalTestingFramework/Util/TestManifest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestManifest.php b/src/Magento/FunctionalTestingFramework/Util/TestManifest.php index 216c42011..eb3de6953 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestManifest.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestManifest.php @@ -74,7 +74,7 @@ public function recordCest($cestName, $tests) foreach ($tests as $test) { $line = $this->relativeDirPath . DIRECTORY_SEPARATOR . $cestName . '.php:' . $test->getName(); - fwrite($fileResource, $line . "\n"); + fwrite($fileResource, $line . PHP_EOL); } fclose($fileResource); @@ -90,7 +90,7 @@ public function recordPathToExportDir() { $fileResource = fopen($this->filePath, 'a'); $line = $this->relativeDirPath . DIRECTORY_SEPARATOR; - fwrite($fileResource, $line . "\n"); + fwrite($fileResource, $line . PHP_EOL); fclose($fileResource); } } From 2f532fa798f735e28e4b8b5ea9e82333820d6b99 Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Thu, 2 Nov 2017 10:48:59 -0500 Subject: [PATCH 13/23] MQE-495: Unable to use action group parameters in parameterArray - Changed Constant to variable. Constant is now merged actionObject Attributes. --- .../Test/Objects/ActionGroupObject.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php index 58d832c43..3cd4173af 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php @@ -13,7 +13,11 @@ */ class ActionGroupObject { - const VAR_ATTRIBUTES = ['userInput', 'selector', 'page', 'url']; + /** + * Array of variable-enabled attributes. + * @var array + */ + private $varAttributes; /** * The name of the action group @@ -45,6 +49,11 @@ class ActionGroupObject */ public function __construct($name, $arguments, $actions) { + $this->varAttributes = array_merge( + ActionObject::SELECTOR_ENABLED_ATTRIBUTES, + ActionObject::DATA_ENABLED_ATTRIBUTES + ); + $this->varAttributes[] = ActionObject::ACTION_ATTRIBUTE_URL; $this->name = $name; $this->arguments = $arguments; $this->parsedActions = $actions; @@ -87,7 +96,7 @@ private function getResolvedActionsWithArgs($arguments, $actionReferenceKey) $regexPattern = '/{{([\w.\[\]]+)\(*([\w.$\']+)*\)*}}/'; foreach ($this->parsedActions as $action) { - $varAttributes = array_intersect(self::VAR_ATTRIBUTES, array_keys($action->getCustomActionAttributes())); + $varAttributes = array_intersect($this->varAttributes, array_keys($action->getCustomActionAttributes())); $newActionAttributes = []; if (!empty($varAttributes)) { // 1 check to see if we have pertinent var From 0f22e60d96bb6f2efc7f173ef7b625c8fb2baae8 Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Thu, 2 Nov 2017 11:17:17 -0500 Subject: [PATCH 14/23] MQE-496: Unable to pass multiple ActionGroup arguments into parameterized selector - Persisted Data fixes to Anthoula's patch. - Fixed quote logic, caught via verification tests. --- .../Test/Objects/ActionGroupObject.php | 95 +++++++++++++------ .../Util/TestGenerator.php | 23 +++-- 2 files changed, 75 insertions(+), 43 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php index 3cd4173af..42b4b1d4e 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php @@ -93,23 +93,23 @@ private function getResolvedActionsWithArgs($arguments, $actionReferenceKey) // $regexPattern match on: $matches[0] {{section.element(arg.field)}} // $matches[1] = section.element // $matches[2] = arg.field - $regexPattern = '/{{([\w.\[\]]+)\(*([\w.$\']+)*\)*}}/'; + $regexPattern = '/{{([\w.\[\]]+)\(*([\w.$\',\s]+)*\)*}}/'; foreach ($this->parsedActions as $action) { $varAttributes = array_intersect($this->varAttributes, array_keys($action->getCustomActionAttributes())); $newActionAttributes = []; + if (!empty($varAttributes)) { // 1 check to see if we have pertinent var foreach ($varAttributes as $varAttribute) { $attributeValue = $action->getCustomActionAttributes()[$varAttribute]; preg_match_all($regexPattern, $attributeValue, $matches); - if (empty($matches[0])) { continue; } //get rid of full match {{arg.field(arg.field)}} - unset($matches[0]); + array_shift($matches); $newActionAttributes[$varAttribute] = $this->replaceAttributeArguments( $arguments, @@ -141,36 +141,68 @@ private function getResolvedActionsWithArgs($arguments, $actionReferenceKey) */ private function replaceAttributeArguments($arguments, $attributeValue, $matches) { - $matchParametersKey = 2; - $newAttributeVal = $attributeValue; + list($mainValueList, $possibleArgumentsList) = $matches; - foreach ($matches as $key => $match) { - foreach ($match as $variable) { - if (empty($variable)) { - continue; - } - // Truncate arg.field into arg. If 'Literal' was passed, variableName will be null. - $variableName = strstr($variable, '.', true); - // Check if arguments has a mapping for the given variableName - if ($variableName == null || !array_key_exists($variableName, $arguments)) { - continue; - } - $isPersisted = strstr($arguments[$variableName], '$'); - if ($isPersisted) { - $newAttributeVal = $this->replacePersistedArgument( - $arguments[$variableName], - $attributeValue, - $variable, - $variableName, - $key == $matchParametersKey ? true : false - ); - } else { - $newAttributeVal = str_replace($variableName, $arguments[$variableName], $attributeValue); - } + foreach ($mainValueList as $index => $mainValue) { + $possibleArguments = $possibleArgumentsList[$index]; + + $attributeValue = $this->replaceAttributeArgumentInVariable($mainValue, $arguments, $attributeValue); + + // Split on commas, trim all values, and finally filter out all FALSE values + $argumentList = array_filter(array_map('trim', explode(',', $possibleArguments))); + + foreach ($argumentList as $argumentValue) { + $attributeValue = $this->replaceAttributeArgumentInVariable( + $argumentValue, + $arguments, + $attributeValue, + true + ); } } - return $newAttributeVal; + return $attributeValue; + } + + /** + * Replace attribute arguments in variable. + * + * @param string $variable + * @param array $arguments + * @param string $attributeValue + * @param bool $isInnerArgument + * @return string + */ + private function replaceAttributeArgumentInVariable( + $variable, + $arguments, + $attributeValue, + $isInnerArgument = false + ) { + // Truncate arg.field into arg + $variableName = strstr($variable, '.', true); + // Check if arguments has a mapping for the given variableName + + if ($variableName === false) { + $variableName = $variable; + } + + if (!array_key_exists($variableName, $arguments)) { + return $attributeValue; + } + + $isPersisted = strstr($arguments[$variableName], '$'); + if ($isPersisted) { + return $this->replacePersistedArgument( + $arguments[$variableName], + $attributeValue, + $variable, + $variableName, + $isInnerArgument + ); + } + + return str_replace($variableName, $arguments[$variableName], $attributeValue); } /** @@ -197,11 +229,12 @@ private function replacePersistedArgument($replacement, $attributeValue, $fullVa // parameter replacements require changing of (arg.field) to ($arg.field$) if ($isParameter) { - $newAttributeValue = str_replace($fullVariable, $scope . $fullVariable . $scope, $newAttributeValue); + $fullReplacement = str_replace($variable, trim($replacement, '$'), $fullVariable); + $newAttributeValue = str_replace($fullVariable, $scope . $fullReplacement . $scope, $newAttributeValue); } else { $newAttributeValue = str_replace('{{', $scope, str_replace('}}', $scope, $newAttributeValue)); + $newAttributeValue = str_replace($variable, trim($replacement, '$'), $newAttributeValue); } - $newAttributeValue = str_replace($variable, trim($replacement, '$'), $newAttributeValue); return $newAttributeValue; } diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index f1c2b630a..264bc7a26 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -913,6 +913,8 @@ private function resolveTestVariable($inputString, $args) */ private function replaceMatchesIntoArg($matches, &$outputArg, $delimiter) { + // Remove Duplicate $matches from array. Duplicate matches are replaced all in one go. + $matches = array_unique($matches); foreach ($matches as $match) { $replacement = null; $variable = $this->stripAndSplitReference($match, $delimiter); @@ -950,25 +952,22 @@ private function processQuoteBreaks($match, $argument, $replacement) $outputArg = $argument; $beforeIndex = strpos($outputArg, $match) - 1; $afterIndex = $beforeIndex + strlen($match) + 1; - $quoteBefore = true; - $quoteAfter = true; - // Prepare replacement with quote breaks if needed - if ($argument[$beforeIndex] != "\"") { - $replacement = '" . ' . $replacement; - $quoteBefore = false; - } - if ($argument[$afterIndex] != "\"") { - $replacement = $replacement . ' . "'; - $quoteAfter = false; - } - //Remove quotes at either end of argument if they aren't necessary. + // Determine if there is a " before/after the $match, and if there is only one " before/after match. + $quoteBefore = $argument[$beforeIndex] == '"' && substr_count($argument, '"', 0, $beforeIndex)<1; + $quoteAfter = $argument[$afterIndex] == '"' && substr_count($argument, '"', $afterIndex+1)<1; + + //Remove quotes at either end of argument if they aren't necessary. Add double-quote concatenation if needed. if ($quoteBefore) { $outputArg = substr($outputArg, 0, $beforeIndex) . substr($outputArg, $beforeIndex+1); $afterIndex--; + } else { + $replacement = '" . ' . $replacement; } if ($quoteAfter) { $outputArg = substr($outputArg, 0, $afterIndex) . substr($outputArg, $afterIndex+1); + } else { + $replacement = $replacement . ' . "'; } $outputArg = str_replace($match, $replacement, $outputArg); return $outputArg; From 8f632fdb718af0fa65e0daa9b1c1eb3c8f769110 Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Thu, 2 Nov 2017 13:54:57 -0500 Subject: [PATCH 15/23] MQE-395: Throw an exception when a test references an actionGroup that doesn't exist - Throwing testReferenceException if actionGroup returned is null. --- .../Test/Handlers/ActionGroupObjectHandler.php | 6 +++++- .../Test/Util/ActionMergeUtil.php | 10 +++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php b/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php index 7ba2b4cbb..cb5f6df78 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php +++ b/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php @@ -66,7 +66,11 @@ private function __construct() */ public function getObject($actionGroupName) { - return $this->getAllObjects()[$actionGroupName]; + if (array_key_exists($actionGroupName, $this->getAllObjects())) { + return $this->getAllObjects()[$actionGroupName]; + } + + return null; } /** diff --git a/src/Magento/FunctionalTestingFramework/Test/Util/ActionMergeUtil.php b/src/Magento/FunctionalTestingFramework/Test/Util/ActionMergeUtil.php index 391674650..f90b70ca5 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Util/ActionMergeUtil.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/ActionMergeUtil.php @@ -6,6 +6,7 @@ namespace Magento\FunctionalTestingFramework\Test\Util; +use Magento\FunctionalTestingFramework\Exceptions\TestReferenceException; use Magento\FunctionalTestingFramework\Exceptions\XmlException; use Magento\FunctionalTestingFramework\Test\Handlers\ActionGroupObjectHandler; use Magento\FunctionalTestingFramework\Test\Objects\ActionObject; @@ -69,6 +70,7 @@ public function resolveActionSteps($parsedSteps, $skipActionGroupResolution = fa * Method to resolve action group references and insert relevant actions into step flow * * @param array $mergedSteps + * @throws TestReferenceException * @return array */ private function resolveActionGroups($mergedSteps) @@ -78,9 +80,11 @@ private function resolveActionGroups($mergedSteps) foreach ($mergedSteps as $key => $mergedStep) { /**@var ActionObject $mergedStep**/ if ($mergedStep->getType() == ActionObjectExtractor::ACTION_GROUP_TAG) { - $actionGroup = ActionGroupObjectHandler::getInstance()->getObject( - $mergedStep->getCustomActionAttributes()[ActionObjectExtractor::ACTION_GROUP_REF] - ); + $actionGroupRef = $mergedStep->getCustomActionAttributes()[ActionObjectExtractor::ACTION_GROUP_REF]; + $actionGroup = ActionGroupObjectHandler::getInstance()->getObject($actionGroupRef); + if ($actionGroup == null) { + throw new TestReferenceException("Could not find ActionGroup by ref \"{$actionGroupRef}\""); + } $args = $mergedStep->getCustomActionAttributes()[ActionObjectExtractor::ACTION_GROUP_ARGUMENTS] ?? null; $actionsToMerge = $actionGroup->getSteps($args, $key); $newOrderedList = $newOrderedList + $actionsToMerge; From 07e5a0682b8c8a70c0e49ebafd4740ac67e9d2b3 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Fri, 3 Nov 2017 16:08:25 -0500 Subject: [PATCH 16/23] MQE-465: refactored entity update mechanism and removed path param type. --- .../DataGenerator/Persist/CurlHandler.php | 3 ++- .../Persist/OperationDataArrayResolver.php | 18 +++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php index a4a574dd2..2504ada77 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php @@ -124,7 +124,8 @@ public function executeRequest($dependentEntities) $this->requestData = $operationDataResolver->resolveOperationDataArray( $this->entityObject, $this->operationDefinition->getOperationMetadata(), - $this->operationDefinition->getOperation() + $this->operationDefinition->getOperation(), + false ); if (($contentType === 'application/json') && ($authorization === 'adminOauth')) { diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php index e9184d015..9f167a768 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php @@ -61,11 +61,11 @@ public function __construct($dependentEntities = null) * @param EntityDataObject $entityObject * @param array $operationMetadata * @param string $operation - * @param integer $depth + * @param bool $fromArray * @return array * @throws \Exception */ - public function resolveOperationDataArray($entityObject, $operationMetadata, $operation, $depth = 0) + public function resolveOperationDataArray($entityObject, $operationMetadata, $operation, $fromArray = false) { $operationDataArray = []; self::incrementSequence($entityObject->getName()); @@ -87,9 +87,9 @@ public function resolveOperationDataArray($entityObject, $operationMetadata, $op $entityObj, $operationElement->getNestedMetadata(), $operation, - $depth+1 + $fromArray ); - if ($depth == 0) { + if (!$fromArray) { $operationDataArray[$operationElement->getKey()] = $operationData; } else { $operationDataArray = $operationData; @@ -148,7 +148,7 @@ public function resolveOperationDataArray($entityObject, $operationMetadata, $op $entityName, $operationElement, $operation, - $depth + $fromArray ); if ($operationElement->getType() == OperationDefinitionObjectHandler::ENTITY_OPERATION_ARRAY) { @@ -254,10 +254,10 @@ private function resolveOperationObjectAndEntityData($entityObject, $operationEl * @param string $entityName * @param OperationElement $operationElement * @param string $operation - * @param integer $depth + * @param bool $fromArray * @return array */ - private function resolveNonPrimitiveElement($entityName, $operationElement, $operation, $depth) + private function resolveNonPrimitiveElement($entityName, $operationElement, $operation, $fromArray = false) { $linkedEntityObj = $this->resolveLinkedEntityObject($entityName); @@ -269,7 +269,7 @@ private function resolveNonPrimitiveElement($entityName, $operationElement, $ope $linkedEntityObj, [$operationElement->getNestedOperationElement($operationElement->getValue())], $operation, - $depth+1 + true ); return $operationSubArray; @@ -280,7 +280,7 @@ private function resolveNonPrimitiveElement($entityName, $operationElement, $ope $linkedEntityObj->getType() )->getOperationMetadata(); - return $this->resolveOperationDataArray($linkedEntityObj, $operationMetadata, $operation); + return $this->resolveOperationDataArray($linkedEntityObj, $operationMetadata, $operation, $fromArray); } /** From 6daf60a2daa43b74b62ee565f649a6431e52526a Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Tue, 31 Oct 2017 13:31:24 -0500 Subject: [PATCH 17/23] MQE-484: parameter array with data replacement does not generate uniqueness function correctly (#25) - ParameterArray now correctly replaces "{{data.key}}" uniqueness. - Verification test creation - add support for consistent array declaration - change functionality for pressKey - add exception for improperly formatted parameter array --- .../Resources/BasicFunctionalCest.txt | 5 +- .../Resources/ParameterArrayCest.txt | 42 ++++++++++ .../TestModule/Cest/ParameterArrayCest.xml | 25 ++++++ .../TestModule/Cest/basicFunctionalCest.xml | 5 +- .../TestModule/Data/ParameterArrayData.xml | 16 ++++ .../verification/Tests/ParameterArrayTest.php | 42 ++++++++++ .../Util/TestGenerator.php | 80 ++++++++++++++++++- 7 files changed, 211 insertions(+), 4 deletions(-) create mode 100644 dev/tests/verification/Resources/ParameterArrayCest.txt create mode 100644 dev/tests/verification/TestModule/Cest/ParameterArrayCest.xml create mode 100644 dev/tests/verification/TestModule/Data/ParameterArrayData.xml create mode 100644 dev/tests/verification/Tests/ParameterArrayTest.php diff --git a/dev/tests/verification/Resources/BasicFunctionalCest.txt b/dev/tests/verification/Resources/BasicFunctionalCest.txt index f17e73e1e..94bba2310 100644 --- a/dev/tests/verification/Resources/BasicFunctionalCest.txt +++ b/dev/tests/verification/Resources/BasicFunctionalCest.txt @@ -89,7 +89,10 @@ class BasicFunctionalCest $I->moveMouseOver(".functionalTestSelector"); $I->openNewTab(); $I->pauseExecution(); - $I->pressKey(".functionalTestSelector"); + $I->pressKey("#page", "a"); + $I->pressKey("#page", ['ctrl','a'],'new'); + $I->pressKey("#page", ['shift','111'],'1','x'); + $I->pressKey("#page", ['ctrl', 'a'],\Facebook\WebDriver\WebDriverKeys::DELETE); $I->reloadPage(); $I->resetCookie("cookieInput"); $I->resizeWindow(0, 0); diff --git a/dev/tests/verification/Resources/ParameterArrayCest.txt b/dev/tests/verification/Resources/ParameterArrayCest.txt new file mode 100644 index 000000000..8011e76b3 --- /dev/null +++ b/dev/tests/verification/Resources/ParameterArrayCest.txt @@ -0,0 +1,42 @@ +amGoingTo("create entity that has the mergeKey: simpleDataKey"); + $simpleParamData = DataObjectHandler::getInstance()->getObject("simpleParamData"); + $simpleDataKey = new DataPersistenceHandler($simpleParamData); + $simpleDataKey->createEntity(); + $I->searchAndMultiSelectOption("#selector", ["name"]); + $I->searchAndMultiSelectOption("#selector", [msq("simpleParamData")."prename"]); + $I->searchAndMultiSelectOption("#selector", ["postname".msq("simpleParamData")]); + $I->searchAndMultiSelectOption("#selector", [$simpleDataKey->getCreatedDataByName('name')]); + $I->searchAndMultiSelectOption("#selector", ["name", $simpleDataKey->getCreatedDataByName('name')]); + $I->searchAndMultiSelectOption("#selector", ['someKey' => $simpleDataKey->getCreatedDataByName('name')]); + $I->searchAndMultiSelectOption("#selector", ['someKey' => "name"]); + $I->searchAndMultiSelectOption("#selector", ['someKey' => msq("simpleParamData")."prename"]); + $I->searchAndMultiSelectOption("#selector", ['someKey' => "postname".msq("simpleParamData")]); + } +} diff --git a/dev/tests/verification/TestModule/Cest/ParameterArrayCest.xml b/dev/tests/verification/TestModule/Cest/ParameterArrayCest.xml new file mode 100644 index 000000000..8bd88fdd7 --- /dev/null +++ b/dev/tests/verification/TestModule/Cest/ParameterArrayCest.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + diff --git a/dev/tests/verification/TestModule/Cest/basicFunctionalCest.xml b/dev/tests/verification/TestModule/Cest/basicFunctionalCest.xml index 33036f3eb..28578bd44 100644 --- a/dev/tests/verification/TestModule/Cest/basicFunctionalCest.xml +++ b/dev/tests/verification/TestModule/Cest/basicFunctionalCest.xml @@ -74,7 +74,10 @@ - + + + + diff --git a/dev/tests/verification/TestModule/Data/ParameterArrayData.xml b/dev/tests/verification/TestModule/Data/ParameterArrayData.xml new file mode 100644 index 000000000..45b0c96d2 --- /dev/null +++ b/dev/tests/verification/TestModule/Data/ParameterArrayData.xml @@ -0,0 +1,16 @@ + + + + + + name + prename + postname + + diff --git a/dev/tests/verification/Tests/ParameterArrayTest.php b/dev/tests/verification/Tests/ParameterArrayTest.php new file mode 100644 index 000000000..1d9010c3d --- /dev/null +++ b/dev/tests/verification/Tests/ParameterArrayTest.php @@ -0,0 +1,42 @@ +getObject(self::PARAMETER_ARRAY_CEST); + $test = TestGenerator::getInstance(null, [$cest]); + $test->createAllCestFiles(); + + $cestFile = $test->getExportDir() . + DIRECTORY_SEPARATOR . + self::PARAMETER_ARRAY_CEST . + ".php"; + + $this->assertTrue(file_exists($cestFile)); + + $fileDiffUtil = new FileDiffUtil( + self::RESOURCES_PATH . DIRECTORY_SEPARATOR . self::PARAMETER_ARRAY_CEST . ".txt", + $cestFile + ); + + $diffResult = $fileDiffUtil->diffContents(); + $this->assertNull($diffResult, $diffResult); + } +} diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 36e09a5a5..9fec5d0dd 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -375,8 +375,13 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) $time = $customActionAttributes['timeout']; } - if (isset($customActionAttributes['parameterArray'])) { - $parameterArray = $customActionAttributes['parameterArray']; + if (isset($customActionAttributes['parameterArray']) && $actionName != 'pressKey') { + // validate the param array is in the correct format + $this->validateParameterArray($customActionAttributes['parameterArray']); + + $parameterArray = "[" . $this->addUniquenessToParamArray( + $customActionAttributes['parameterArray'] + ) . "]"; } if (isset($customActionAttributes['requiredAction'])) { @@ -720,6 +725,29 @@ private function generateStepsPhp($stepsObject, $stepsData, $hookObject = false) $testSteps .= $this->wrapFunctionCall($actor, $actionName, $selector, $parameterArray); break; case "pressKey": + $parameterArray = $customActionAttributes['parameterArray'] ?? null; + if ($parameterArray) { + // validate the param array is in the correct format + $this->validateParameterArray($parameterArray); + + // trim off the outer braces and add commas for the regex match + $params = "," . substr($parameterArray, 1, strlen($parameterArray) - 2) . ","; + + // we are matching any nested arrays for a simultaneous press, any string literals, and any + // explicit function calls from a class. + preg_match_all('/(\[.*?\])|(\'.*?\')|(\\\\.*?\,)/', $params, $paramInput); + + //clean up the input by trimming any extra commas + $tmpParameterArray = []; + foreach ($paramInput[0] as $params) { + $tmpParameterArray[] = trim($params, ","); + } + + // put the array together as a string to be passed as args + $parameterArray = implode(",", $tmpParameterArray); + } + $testSteps .= $this->wrapFunctionCall($actor, $actionName, $selector, $input, $parameterArray); + break; case "selectOption": $testSteps .= $this->wrapFunctionCall($actor, $actionName, $selector, $input, $parameterArray); break; @@ -1166,6 +1194,40 @@ private function generateTestsPhp($testsObject) return $testPhp; } + /** + * Detects uniqueness function calls on given attribute, and calls addUniquenessFunctionCall on matches. + * @param string $input + * @return string + */ + private function addUniquenessToParamArray($input) + { + $tempInput = trim($input, "[]"); + $paramArray = explode(",", $tempInput); + $result = []; + + foreach ($paramArray as $param) { + // Determine if param has key/value array notation + if (preg_match_all('/(.+)=>(.+)/', trim($param), $paramMatches)) { + $param1 = $this->addUniquenessToParamArray($paramMatches[1][0]); + $param2 = $this->addUniquenessToParamArray($paramMatches[2][0]); + $result[] = trim($param1) . " => " . trim($param2); + continue; + } + + // Matches strings wrapped in ', we assume these are string literals + if (preg_match('/^(["\']).*\1$/m', trim($param))) { + $result[] = $param; + continue; + } + + $replacement = $this->addUniquenessFunctionCall(trim($param)); + + $result[] = $replacement; + } + + return implode(", ", $result); + } + /** * Add uniqueness function call to input string based on regex pattern. * @@ -1300,4 +1362,18 @@ private function wrapFunctionCallWithReturnValue($returnVariable, $actor, $actio return $this->resolveTestVariable($output, $args); } // @codingStandardsIgnoreEnd + + /** + * Validates parameter array format, making sure user has enclosed string with square brackets. + * + * @param string $paramArray + * @return void + * @throws TestReferenceException + */ + private function validateParameterArray($paramArray) + { + if (substr($paramArray, 0, 1) != "[" || substr($paramArray, strlen($paramArray)-1, 1)!= "]") { + throw new TestReferenceException("parameterArray must begin with `[` and end with `]"); + } + } } From fb88f3a8a1fc7f5c8ce29b853dc8702fcb2ec702 Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Wed, 1 Nov 2017 11:48:25 -0500 Subject: [PATCH 18/23] MQE-477: Generate tests throws warning when using action groups in merged tests. - Changed setter of argData[argument] to not error on null arguments. --- .../Test/Util/ActionObjectExtractor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php b/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php index 4f75f5db8..b137102e4 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php @@ -107,7 +107,7 @@ private function processActionGroupArgs($actionAttributeData) } $actionAttributeArgData[self::ACTION_GROUP_ARGUMENTS][$attributeDataKey] = - $attributeDataValues[self::ACTION_GROUP_ARG_VALUE]; + $attributeDataValues[self::ACTION_GROUP_ARG_VALUE] ?? null; } return $actionAttributeArgData; From ed0361500b6258761ffa43fb2403d9c046e8a0fc Mon Sep 17 00:00:00 2001 From: Ian Meron Date: Mon, 6 Nov 2017 10:06:38 -0600 Subject: [PATCH 19/23] MQE-433: Create merge step/action-group verification tests - add new verification tests around action-group - edit action group arg in unit test for failure - add verification tests around merge of xml --- .../Test/Util/ActionMergeUtilTest.php | 4 +- .../Resources/ActionGroupFunctionalCest.txt | 164 ++++++++++++++++++ .../Resources/MergeFunctionalCest.txt | 69 ++++++++ .../Resources/ParameterArrayCest.txt | 2 +- .../ActionGroup/functionalActionGroup.xml | 41 +++++ .../mergeFunctionalActionGroup.xml | 16 ++ .../TestModule/ActionObject/placeholder.txt | 0 .../Cest/actionGroupFunctionalCest.xml | 71 ++++++++ .../Cest/mergeBaseFunctionalCest.xml | 36 ++++ .../TestModule/Cest/mergeInFunctionalCest.xml | 30 ++++ .../Data/persistedReplacementData.xml | 5 + .../Data/persistedReplacementMergeData.xml | 16 ++ .../TestModule/Data/placeholder.txt | 0 .../TestModule/Page/placeholder.txt | 0 .../TestModule/Section/SampleSection.xml | 3 +- .../TestModule/Section/placeholder.txt | 0 .../TestModule/Section/zMergeSection.xml | 19 ++ .../Tests/ActionGroupMergeGenerationTest.php | 52 ++++++ .../Tests/BasicCestGenerationTest.php | 6 +- .../verification/Tests/ParameterArrayTest.php | 6 +- .../PersistedReplacementGenerationTest.php | 6 +- .../Tests/SuiteGenerationTest.php | 4 +- dev/tests/verification/Util/FileDiffUtil.php | 53 ------ .../Suite/Util/SuiteObjectExtractor.php | 2 + .../Test/Config/Converter/Dom/Flat.php | 2 +- .../Test/Objects/ActionGroupObject.php | 7 +- .../Test/Objects/CestHookObject.php | 13 +- .../Test/Objects/TestObject.php | 2 +- .../Test/Util/ActionMergeUtil.php | 27 ++- .../Test/Util/CestHookObjectExtractor.php | 4 +- .../Test/Util/CestObjectExtractor.php | 2 + 31 files changed, 576 insertions(+), 86 deletions(-) create mode 100644 dev/tests/verification/Resources/ActionGroupFunctionalCest.txt create mode 100644 dev/tests/verification/Resources/MergeFunctionalCest.txt create mode 100644 dev/tests/verification/TestModule/ActionGroup/functionalActionGroup.xml create mode 100644 dev/tests/verification/TestModule/ActionGroup/mergeFunctionalActionGroup.xml delete mode 100644 dev/tests/verification/TestModule/ActionObject/placeholder.txt create mode 100644 dev/tests/verification/TestModule/Cest/actionGroupFunctionalCest.xml create mode 100644 dev/tests/verification/TestModule/Cest/mergeBaseFunctionalCest.xml create mode 100644 dev/tests/verification/TestModule/Cest/mergeInFunctionalCest.xml create mode 100644 dev/tests/verification/TestModule/Data/persistedReplacementMergeData.xml delete mode 100644 dev/tests/verification/TestModule/Data/placeholder.txt delete mode 100644 dev/tests/verification/TestModule/Page/placeholder.txt delete mode 100644 dev/tests/verification/TestModule/Section/placeholder.txt create mode 100644 dev/tests/verification/TestModule/Section/zMergeSection.xml create mode 100644 dev/tests/verification/Tests/ActionGroupMergeGenerationTest.php delete mode 100644 dev/tests/verification/Util/FileDiffUtil.php diff --git a/dev/tests/unit/Magento/FunctionalTestFramework/Test/Util/ActionMergeUtilTest.php b/dev/tests/unit/Magento/FunctionalTestFramework/Test/Util/ActionMergeUtilTest.php index 1c5d68724..495f6eff1 100644 --- a/dev/tests/unit/Magento/FunctionalTestFramework/Test/Util/ActionMergeUtilTest.php +++ b/dev/tests/unit/Magento/FunctionalTestFramework/Test/Util/ActionMergeUtilTest.php @@ -30,7 +30,7 @@ class ActionMergeUtilTest extends TestCase */ public static function setUpBeforeClass() { - self::$MERGE_UTIL = new ActionMergeUtil(); + self::$MERGE_UTIL = new ActionMergeUtil("actionMergeUtilTest", "TestCase"); } /** @@ -149,7 +149,7 @@ public function testResolveActionStepEntityData() $this->assertEquals($userinputValue, $actions[$actionName]->getCustomActionAttributes()[$userInputKey]); - $mergeUtil = new ActionMergeUtil(); + $mergeUtil = new ActionMergeUtil("test", "TestCase"); $resolvedActions = $mergeUtil->resolveActionSteps($actions); $this->assertEquals($dataFieldValue, $resolvedActions[$actionName]->getCustomActionAttributes()[$userInputKey]); diff --git a/dev/tests/verification/Resources/ActionGroupFunctionalCest.txt b/dev/tests/verification/Resources/ActionGroupFunctionalCest.txt new file mode 100644 index 000000000..5ede1b222 --- /dev/null +++ b/dev/tests/verification/Resources/ActionGroupFunctionalCest.txt @@ -0,0 +1,164 @@ +amGoingTo("create entity that has the mergeKey: createPersonParam"); + $replacementPerson = DataObjectHandler::getInstance()->getObject("replacementPerson"); + $this->createPersonParam = new DataPersistenceHandler($replacementPerson); + $this->createPersonParam->createEntity(); + } + + /** + * @Parameter(name = "AcceptanceTester", value="$I") + * @param AcceptanceTester $I + * @return void + */ + public function BasicActionGroupTest(AcceptanceTester $I) + { + $I->amOnPage("/someUrl"); + $I->fillField("#foo", "myData1"); + $I->fillField("#bar", "myData2"); + $I->click("loginButton"); + } + + /** + * @Parameter(name = "AcceptanceTester", value="$I") + * @param AcceptanceTester $I + * @return void + */ + public function ActionGroupWithDataTest(AcceptanceTester $I) + { + $I->amOnPage("/someUrl"); + $I->amOnPage("/Jane/Dane.html"); + $I->fillField("#foo", "Jane"); + $I->fillField("#bar", "Dane"); + $I->searchAndMultiSelectOption("#foo", ["Jane", "Dane"]); + $I->see("#element .Jane"); + $I->click("loginButton"); + } + + /** + * @Parameter(name = "AcceptanceTester", value="$I") + * @param AcceptanceTester $I + * @return void + */ + public function ActionGroupWithDataOverrideTest(AcceptanceTester $I) + { + $I->amOnPage("/someUrl"); + $I->amOnPage("/John/Doe.html"); + $I->fillField("#foo", "John"); + $I->fillField("#bar", "Doe"); + $I->searchAndMultiSelectOption("#foo", ["John", "Doe"]); + $I->see("#element .John"); + $I->click("loginButton"); + } + + /** + * @Parameter(name = "AcceptanceTester", value="$I") + * @param AcceptanceTester $I + * @return void + */ + public function ActionGroupWithNoDefaultTest(AcceptanceTester $I) + { + $I->amOnPage("/someUrl"); + $I->fillField("#foo", "Jane"); + $I->fillField("#bar", "Dane"); + $I->see("#Jane .Dane"); + $I->click("loginButton"); + } + + /** + * @Parameter(name = "AcceptanceTester", value="$I") + * @param AcceptanceTester $I + * @return void + */ + public function ActionGroupWithPersistedData(AcceptanceTester $I) + { + $I->amGoingTo("create entity that has the mergeKey: createPerson"); + $defaultPerson = DataObjectHandler::getInstance()->getObject("defaultPerson"); + $createPerson = new DataPersistenceHandler($defaultPerson); + $createPerson->createEntity(); + $I->amOnPage("/" . $createPerson->getCreatedDataByName('firstname') . "/" . $createPerson->getCreatedDataByName('lastname') . ".html"); + $I->fillField("#foo", $createPerson->getCreatedDataByName('firstname')); + $I->fillField("#bar", $createPerson->getCreatedDataByName('lastname')); + $I->searchAndMultiSelectOption("#foo", [$createPerson->getCreatedDataByName('firstname') . "", "" . $createPerson->getCreatedDataByName('lastname')]); + $I->see("#element ." . $createPerson->getCreatedDataByName('firstname')); + } + + /** + * @Parameter(name = "AcceptanceTester", value="$I") + * @param AcceptanceTester $I + * @return void + */ + public function ActionGroupWithTopLevelPersistedData(AcceptanceTester $I) + { + $I->amOnPage("/" . $this->createPersonParam->getCreatedDataByName('firstname') . "/" . $this->createPersonParam->getCreatedDataByName('lastname') . ".html"); + $I->fillField("#foo", $this->createPersonParam->getCreatedDataByName('firstname')); + $I->fillField("#bar", $this->createPersonParam->getCreatedDataByName('lastname')); + $I->searchAndMultiSelectOption("#foo", [$this->createPersonParam->getCreatedDataByName('firstname') . "", "" . $this->createPersonParam->getCreatedDataByName('lastname')]); + $I->see("#element ." . $this->createPersonParam->getCreatedDataByName('firstname')); + } + + /** + * @Parameter(name = "AcceptanceTester", value="$I") + * @param AcceptanceTester $I + * @return void + */ + public function MultipleActionGroupsTest(AcceptanceTester $I) + { + $I->amOnPage("/someUrl"); + $I->amOnPage("/Jane/Dane.html"); + $I->fillField("#foo", "Jane"); + $I->fillField("#bar", "Dane"); + $I->searchAndMultiSelectOption("#foo", ["Jane", "Dane"]); + $I->see("#element .Jane"); + $I->click("loginButton"); + $I->amOnPage("/John/Doe.html"); + $I->fillField("#foo", "John"); + $I->fillField("#bar", "Doe"); + $I->searchAndMultiSelectOption("#foo", ["John", "Doe"]); + $I->see("#element .John"); + } + + /** + * @Parameter(name = "AcceptanceTester", value="$I") + * @param AcceptanceTester $I + * @return void + */ + public function MergedActionGroupTest(AcceptanceTester $I) + { + $I->see("#element .Jane"); + $I->see(".merge .Jane"); + $I->click(".merge .Dane"); + $I->amOnPage("/Jane/Dane.html"); + } + +} diff --git a/dev/tests/verification/Resources/MergeFunctionalCest.txt b/dev/tests/verification/Resources/MergeFunctionalCest.txt new file mode 100644 index 000000000..9645490bb --- /dev/null +++ b/dev/tests/verification/Resources/MergeFunctionalCest.txt @@ -0,0 +1,69 @@ +amOnPage("/beforeUrl"); + $I->see("#before2"); + } + + public function _after(AcceptanceTester $I) + { + $I->amOnPage("/afterUrl1"); + } + + /** + * @Parameter(name = "AcceptanceTester", value="$I") + * @param AcceptanceTester $I + * @return void + */ + public function BasicMergeTest(AcceptanceTester $I) + { + $I->amOnPage("/step1"); + $I->click("#step2"); + $I->fillField("#username", "step3"); + $I->click("#step4"); + $I->fillField("#password", "step5"); + $I->click("#step6Merged"); + $I->click("#element .Jane .step7Merge"); + $I->amOnPage("/Jane/Dane.html"); + $I->fillField("#foo", "Jane"); + $I->fillField("#bar", "Dane"); + $I->searchAndMultiSelectOption("#foo", ["Jane", "Dane"]); + $I->see("#element .Jane"); + } + + /** + * @Parameter(name = "AcceptanceTester", value="$I") + * @param AcceptanceTester $I + * @return void + */ + public function MergedReferencesTest(AcceptanceTester $I) + { + $I->fillField("#merge", "merged"); + $I->fillField("#newElement", "newField"); + } + +} diff --git a/dev/tests/verification/Resources/ParameterArrayCest.txt b/dev/tests/verification/Resources/ParameterArrayCest.txt index 8011e76b3..1e4ae4b39 100644 --- a/dev/tests/verification/Resources/ParameterArrayCest.txt +++ b/dev/tests/verification/Resources/ParameterArrayCest.txt @@ -33,7 +33,7 @@ class ParameterArrayCest $I->searchAndMultiSelectOption("#selector", [msq("simpleParamData")."prename"]); $I->searchAndMultiSelectOption("#selector", ["postname".msq("simpleParamData")]); $I->searchAndMultiSelectOption("#selector", [$simpleDataKey->getCreatedDataByName('name')]); - $I->searchAndMultiSelectOption("#selector", ["name", $simpleDataKey->getCreatedDataByName('name')]); + $I->searchAndMultiSelectOption("#selector", ["name", "" . $simpleDataKey->getCreatedDataByName('name')]); $I->searchAndMultiSelectOption("#selector", ['someKey' => $simpleDataKey->getCreatedDataByName('name')]); $I->searchAndMultiSelectOption("#selector", ['someKey' => "name"]); $I->searchAndMultiSelectOption("#selector", ['someKey' => msq("simpleParamData")."prename"]); diff --git a/dev/tests/verification/TestModule/ActionGroup/functionalActionGroup.xml b/dev/tests/verification/TestModule/ActionGroup/functionalActionGroup.xml new file mode 100644 index 000000000..e9ce573e0 --- /dev/null +++ b/dev/tests/verification/TestModule/ActionGroup/functionalActionGroup.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/tests/verification/TestModule/ActionGroup/mergeFunctionalActionGroup.xml b/dev/tests/verification/TestModule/ActionGroup/mergeFunctionalActionGroup.xml new file mode 100644 index 000000000..a1a8cd089 --- /dev/null +++ b/dev/tests/verification/TestModule/ActionGroup/mergeFunctionalActionGroup.xml @@ -0,0 +1,16 @@ + + + + + + + + + + \ No newline at end of file diff --git a/dev/tests/verification/TestModule/ActionObject/placeholder.txt b/dev/tests/verification/TestModule/ActionObject/placeholder.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/dev/tests/verification/TestModule/Cest/actionGroupFunctionalCest.xml b/dev/tests/verification/TestModule/Cest/actionGroupFunctionalCest.xml new file mode 100644 index 000000000..abbe6f71a --- /dev/null +++ b/dev/tests/verification/TestModule/Cest/actionGroupFunctionalCest.xml @@ -0,0 +1,71 @@ + + + + + + + + + <group value="functional"/> + <features value="Action Group Functional Cest"/> + <stories value="MQE-433"/> + </annotations> + <before> + <createData entity="replacementPerson" mergeKey="createPersonParam"/> + </before> + <test name="BasicActionGroupTest"> + <amOnPage mergeKey="step1" url="/someUrl"/> + <actionGroup ref="functionalActionGroup" mergeKey="actionGroup1"/> + <click mergeKey="step6" selector="loginButton"/> + </test> + <test name="ActionGroupWithDataTest"> + <amOnPage mergeKey="step1" url="/someUrl"/> + <actionGroup ref="functionalActionGroupWithData" mergeKey="actionGroupWithData1"/> + <click mergeKey="step6" selector="loginButton"/> + </test> + <test name="ActionGroupWithDataOverrideTest"> + <amOnPage mergeKey="step1" url="/someUrl"/> + <actionGroup ref="functionalActionGroupWithData" mergeKey="actionGroupWithDataOverride1"> + <argument name="person" value="replacementPerson"/> + </actionGroup> + <click mergeKey="step6" selector="loginButton"/> + </test> + <test name="ActionGroupWithNoDefaultTest"> + <amOnPage mergeKey="step1" url="/someUrl"/> + <actionGroup ref="functionalActionGroupNoDefault" mergeKey="actionGroupWithDataOverride1"> + <argument name="person" value="defaultPerson"/> + </actionGroup> + <click mergeKey="step6" selector="loginButton"/> + </test> + <test name="ActionGroupWithPersistedData"> + <createData entity="defaultPerson" mergeKey="createPerson"/> + <actionGroup ref="functionalActionGroupWithData" mergeKey="actionGroupWithPersistedData1"> + <argument name="person" value="$createPerson$"/> + </actionGroup> + </test> + <test name="ActionGroupWithTopLevelPersistedData"> + <actionGroup ref="functionalActionGroupWithData" mergeKey="actionGroupWithPersistedData1"> + <argument name="person" value="$$createPersonParam$$"/> + </actionGroup> + </test> + <test name="MultipleActionGroupsTest"> + <amOnPage mergeKey="step1" url="/someUrl"/> + <actionGroup ref="functionalActionGroupWithData" mergeKey="actionGroup1"/> + <click mergeKey="step6" selector="loginButton"/> + <actionGroup ref="functionalActionGroupWithData" mergeKey="actionGroupWithDataOverride2"> + <argument name="person" value="replacementPerson"/> + </actionGroup> + </test> + <test name="MergedActionGroupTest"> + <actionGroup ref="functionalActionGroupForMerge" mergeKey="actionGroupForMerge"> + <argument name="myArg" value="defaultPerson"/> + </actionGroup> + </test> + </cest> +</config> \ No newline at end of file diff --git a/dev/tests/verification/TestModule/Cest/mergeBaseFunctionalCest.xml b/dev/tests/verification/TestModule/Cest/mergeBaseFunctionalCest.xml new file mode 100644 index 000000000..05c6a0b87 --- /dev/null +++ b/dev/tests/verification/TestModule/Cest/mergeBaseFunctionalCest.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> + <cest name="MergeFunctionalCest"> + <annotations> + <severity value="CRITICAL"/> + <title value="A Functional Cest"/> + <group value="functional"/> + <features value="Merge Functional Cest"/> + <stories value="MQE-433"/> + </annotations> + <before> + <amOnPage url="/beforeUrl" mergeKey="before1"/> + </before> + <after> + <amOnPage url="/afterUrl" mergeKey="after1"/> + </after> + <test name="BasicMergeTest"> + <amOnPage mergeKey="step1" url="/step1"/> + <fillField mergeKey="step3" selector="#username" userInput="step3"/> + <fillField mergeKey="step5" selector="#password" userInput="step5"/> + <click mergeKey="step6" selector=".step6"/> + </test> + <test name="MergedReferencesTest"> + <fillField mergeKey="fillField1" selector="{{SampleSection.mergeElement}}" userInput="{{defaultPerson.mergedField}}"/> + <fillField mergeKey="fillField2" selector="{{SampleSection.newElement}}" userInput="{{defaultPerson.newField}}" /> + </test> + </cest> +</config> \ No newline at end of file diff --git a/dev/tests/verification/TestModule/Cest/mergeInFunctionalCest.xml b/dev/tests/verification/TestModule/Cest/mergeInFunctionalCest.xml new file mode 100644 index 000000000..1f32b758b --- /dev/null +++ b/dev/tests/verification/TestModule/Cest/mergeInFunctionalCest.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> + <cest name="MergeFunctionalCest"> + <annotations> + <group value="mergeTest"/> + </annotations> + <before> + <see mergeKey="before2" selector="#before2" after="before1"/> + </before> + <after> + <amOnPage url="/afterUrl1" mergeKey="after1"/> + </after> + <test name="BasicMergeTest"> + <click mergeKey="step7Merge" selector="{{SampleSection.oneParamElement(defaultPerson.firstname)}} .step7Merge" after="step6Merge"/> + <click mergeKey="step2" selector="#step2" after="step1"/> + <click mergeKey="step4" selector="#step4" before="step5"/> + <click mergeKey="step6" remove="true"/> + <click mergeKey="step6Merge" selector="#step6Merged" after="step5"/> + <actionGroup ref="functionalActionGroupWithData" mergeKey="step8Merge" after="step7Merge"/> + </test> + </cest> +</config> \ No newline at end of file diff --git a/dev/tests/verification/TestModule/Data/persistedReplacementData.xml b/dev/tests/verification/TestModule/Data/persistedReplacementData.xml index faec18687..afe4585f1 100644 --- a/dev/tests/verification/TestModule/Data/persistedReplacementData.xml +++ b/dev/tests/verification/TestModule/Data/persistedReplacementData.xml @@ -17,4 +17,9 @@ <data key="firstname" unique="suffix">John</data> <data key="lastName">Doe</data> </entity> + <entity name="defaultPerson" type="samplePerson"> + <data key="firstname">Jane</data> + <data key="lastName">Dane</data> + <data key="mergedField">unmerged</data> + </entity> </config> diff --git a/dev/tests/verification/TestModule/Data/persistedReplacementMergeData.xml b/dev/tests/verification/TestModule/Data/persistedReplacementMergeData.xml new file mode 100644 index 000000000..7f47ffe17 --- /dev/null +++ b/dev/tests/verification/TestModule/Data/persistedReplacementMergeData.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="defaultPerson" type="samplePerson"> + <data key="mergedField">merged</data> + <data key="newField">newField</data> + </entity> +</config> diff --git a/dev/tests/verification/TestModule/Data/placeholder.txt b/dev/tests/verification/TestModule/Data/placeholder.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/dev/tests/verification/TestModule/Page/placeholder.txt b/dev/tests/verification/TestModule/Page/placeholder.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/dev/tests/verification/TestModule/Section/SampleSection.xml b/dev/tests/verification/TestModule/Section/SampleSection.xml index 789e8dfd3..211af228d 100644 --- a/dev/tests/verification/TestModule/Section/SampleSection.xml +++ b/dev/tests/verification/TestModule/Section/SampleSection.xml @@ -7,11 +7,12 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> + xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> <section name="SampleSection"> <element name="oneParamElement" type="button" selector="#element .{{var1}}" parameterized="true"/> <element name="twoParamElement" type="button" selector="#{{var1}} .{{var2}}" parameterized="true"/> <element name="threeParamElement" type="button" selector="#{{var1}}-{{var2}} .{{var3}}" parameterized="true"/> <element name="timeoutElement" type="button" selector="#foo" timeout="30"/> + <element name="mergeElement" type="button" selector="#unMerge"/> </section> </config> diff --git a/dev/tests/verification/TestModule/Section/placeholder.txt b/dev/tests/verification/TestModule/Section/placeholder.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/dev/tests/verification/TestModule/Section/zMergeSection.xml b/dev/tests/verification/TestModule/Section/zMergeSection.xml new file mode 100644 index 000000000..d54416993 --- /dev/null +++ b/dev/tests/verification/TestModule/Section/zMergeSection.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> + <section name="SampleSection"> + <element name="oneParamElement" type="button" selector="#element .{{var1}}" parameterized="true"/> + <element name="twoParamElement" type="button" selector="#{{var1}} .{{var2}}" parameterized="true"/> + <element name="threeParamElement" type="button" selector="#{{var1}}-{{var2}} .{{var3}}" parameterized="true"/> + <element name="timeoutElement" type="button" selector="#foo" timeout="30"/> + <element name="mergeElement" type="select" selector="#merge"/> + <element name="newElement" type="select" selector="#newElement"/> + </section> +</config> \ No newline at end of file diff --git a/dev/tests/verification/Tests/ActionGroupMergeGenerationTest.php b/dev/tests/verification/Tests/ActionGroupMergeGenerationTest.php new file mode 100644 index 000000000..c13698cf3 --- /dev/null +++ b/dev/tests/verification/Tests/ActionGroupMergeGenerationTest.php @@ -0,0 +1,52 @@ +<?php + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace tests\verification\Tests; + +use Magento\FunctionalTestingFramework\Test\Handlers\CestObjectHandler; +use Magento\FunctionalTestingFramework\Util\TestGenerator; +use PHPUnit\Framework\TestCase; + +class ActionGroupMergeGenerationTest extends TestCase +{ + const MERGE_FUNCTIONAL_CEST = 'MergeFunctionalCest'; + const ACTION_GROUP_FUNCTIONAL_CEST = "ActionGroupFunctionalCest"; + const RESOURCES_PATH = __DIR__ . '/../Resources'; + + /** + * Tests flat generation of a hardcoded cest file with no external references. + */ + public function testMergeFunctionalCest() + { + $this->runComparisonTest(self::MERGE_FUNCTIONAL_CEST); + } + + public function testActionGroupFunctionalCest() + { + $this->runComparisonTest(self::ACTION_GROUP_FUNCTIONAL_CEST); + } + + + private function runComparisonTest($cestName) + { + $cest = CestObjectHandler::getInstance()->getObject($cestName); + $test = TestGenerator::getInstance(null, [$cest]); + $test->createAllCestFiles(); + + $cestFile = $test->getExportDir() . + DIRECTORY_SEPARATOR . + $cestName . + ".php"; + + $this->assertTrue(file_exists($cestFile)); + + + $this->assertFileEquals( + self::RESOURCES_PATH . DIRECTORY_SEPARATOR . $cestName . ".txt", + $cestFile + ); + } +} \ No newline at end of file diff --git a/dev/tests/verification/Tests/BasicCestGenerationTest.php b/dev/tests/verification/Tests/BasicCestGenerationTest.php index b53223fce..4c0e2e5e1 100644 --- a/dev/tests/verification/Tests/BasicCestGenerationTest.php +++ b/dev/tests/verification/Tests/BasicCestGenerationTest.php @@ -8,7 +8,6 @@ use Magento\FunctionalTestingFramework\Test\Handlers\CestObjectHandler; use Magento\FunctionalTestingFramework\Util\TestGenerator; use PHPUnit\Framework\TestCase; -use tests\verification\Util\FileDiffUtil; class BasicCestGenerationTest extends TestCase { @@ -31,12 +30,9 @@ public function testBasicGeneration() $this->assertTrue(file_exists($cestFile)); - $fileDiffUtil = new FileDiffUtil( + $this->assertFileEquals( self::RESOURCES_PATH . DIRECTORY_SEPARATOR . self::BASIC_FUNCTIONAL_CEST . ".txt", $cestFile ); - - $diffResult = $fileDiffUtil->diffContents(); - $this->assertNull($diffResult, $diffResult); } } diff --git a/dev/tests/verification/Tests/ParameterArrayTest.php b/dev/tests/verification/Tests/ParameterArrayTest.php index 1d9010c3d..82c6a2dfb 100644 --- a/dev/tests/verification/Tests/ParameterArrayTest.php +++ b/dev/tests/verification/Tests/ParameterArrayTest.php @@ -8,7 +8,6 @@ use Magento\FunctionalTestingFramework\Test\Handlers\CestObjectHandler; use Magento\FunctionalTestingFramework\Util\TestGenerator; use PHPUnit\Framework\TestCase; -use tests\verification\Util\FileDiffUtil; class ParameterArrayTest extends TestCase { @@ -31,12 +30,9 @@ public function testParameterArrayGeneration() $this->assertTrue(file_exists($cestFile)); - $fileDiffUtil = new FileDiffUtil( + $this->assertFileEquals( self::RESOURCES_PATH . DIRECTORY_SEPARATOR . self::PARAMETER_ARRAY_CEST . ".txt", $cestFile ); - - $diffResult = $fileDiffUtil->diffContents(); - $this->assertNull($diffResult, $diffResult); } } diff --git a/dev/tests/verification/Tests/PersistedReplacementGenerationTest.php b/dev/tests/verification/Tests/PersistedReplacementGenerationTest.php index ab74c7331..b95afc99d 100644 --- a/dev/tests/verification/Tests/PersistedReplacementGenerationTest.php +++ b/dev/tests/verification/Tests/PersistedReplacementGenerationTest.php @@ -8,7 +8,6 @@ use Magento\FunctionalTestingFramework\Test\Handlers\CestObjectHandler; use Magento\FunctionalTestingFramework\Util\TestGenerator; use PHPUnit\Framework\TestCase; -use tests\verification\Util\FileDiffUtil; class PersistedReplacementGenerationTest extends TestCase { @@ -31,12 +30,9 @@ public function testPersistedReplacementGeneration() $this->assertTrue(file_exists($cestFile)); - $fileDiffUtil = new FileDiffUtil( + $this->assertFileEquals( self::RESOURCES_PATH . DIRECTORY_SEPARATOR . self::PERSISTED_REPLACEMENT_CEST . ".txt", $cestFile ); - - $diffResult = $fileDiffUtil->diffContents(); - $this->assertNull($diffResult, $diffResult); } } diff --git a/dev/tests/verification/Tests/SuiteGenerationTest.php b/dev/tests/verification/Tests/SuiteGenerationTest.php index ecba7d5cc..fc34b9af1 100644 --- a/dev/tests/verification/Tests/SuiteGenerationTest.php +++ b/dev/tests/verification/Tests/SuiteGenerationTest.php @@ -10,7 +10,6 @@ use Magento\FunctionalTestingFramework\Util\TestManifest; use PHPUnit\Framework\TestCase; use Symfony\Component\Yaml\Yaml; -use tests\verification\Util\FileDiffUtil; class SuiteGenerationTest extends TestCase { @@ -58,8 +57,7 @@ public function testSuiteGeneration1() DIRECTORY_SEPARATOR . TestManifest::TEST_MANIFEST_FILENAME; $expectedManifest = self::RESOURCES_DIR . DIRECTORY_SEPARATOR . __FUNCTION__ . ".txt"; - $fileDiffUtil = new FileDiffUtil($expectedManifest, $actualManifest); - $this->assertNull($fileDiffUtil->diffContents()); + $this->assertFileEquals($expectedManifest, $actualManifest); } public static function tearDownAfterClass() diff --git a/dev/tests/verification/Util/FileDiffUtil.php b/dev/tests/verification/Util/FileDiffUtil.php deleted file mode 100644 index 0937472a1..000000000 --- a/dev/tests/verification/Util/FileDiffUtil.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace tests\verification\Util; - -class FileDiffUtil -{ - /** - * Object which represents the expected file - * - * @var array|bool - */ - private $expectedFile; - - - /** - * Object which represents the actual file - * - * @var array|bool - */ - private $actualFile; - - /** - * FileDiffUtil constructor. - * - * @param string $expectedFilePath - * @param string $actualFilePath - */ - public function __construct($expectedFilePath, $actualFilePath) - { - $this->expectedFile = file($expectedFilePath); - $this->actualFile = file($actualFilePath); - } - - /** - * Function which does a line by line comparison between the contents of the two files fed to the constructor. - * - * @return null|string - */ - public function diffContents() - { - $differingContent = null; - foreach ($this->actualFile as $line_num => $line) { - if ($line != $this->expectedFile[$line_num]) { - return $this->expectedFile[$line_num] . "was expected, but found: ${line} on line ${line_num}."; - } - } - - return $differingContent; - } -} diff --git a/src/Magento/FunctionalTestingFramework/Suite/Util/SuiteObjectExtractor.php b/src/Magento/FunctionalTestingFramework/Suite/Util/SuiteObjectExtractor.php index 04135c867..ddb6f8446 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/Util/SuiteObjectExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Suite/Util/SuiteObjectExtractor.php @@ -68,12 +68,14 @@ public function parseSuiteDataIntoObjects($parsedSuiteData) // parse any object hooks if (array_key_exists(CestObjectExtractor::CEST_BEFORE_HOOK, $parsedSuite)) { $suiteHooks[CestObjectExtractor::CEST_BEFORE_HOOK] = $cestObjectHookExtractor->extractHook( + $parsedSuite[self::NAME], CestObjectExtractor::CEST_BEFORE_HOOK, $parsedSuite[CestObjectExtractor::CEST_BEFORE_HOOK] ); } if (array_key_exists(CestObjectExtractor::CEST_AFTER_HOOK, $parsedSuite)) { $suiteHooks[CestObjectExtractor::CEST_AFTER_HOOK] = $cestObjectHookExtractor->extractHook( + $parsedSuite[self::NAME], CestObjectExtractor::CEST_AFTER_HOOK, $parsedSuite[CestObjectExtractor::CEST_AFTER_HOOK] ); diff --git a/src/Magento/FunctionalTestingFramework/Test/Config/Converter/Dom/Flat.php b/src/Magento/FunctionalTestingFramework/Test/Config/Converter/Dom/Flat.php index e08174604..b00aaa6ed 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Config/Converter/Dom/Flat.php +++ b/src/Magento/FunctionalTestingFramework/Test/Config/Converter/Dom/Flat.php @@ -70,7 +70,7 @@ public function convertXml(\DOMNode $source, $basePath = '') $value = []; /** @var \DOMNode $node */ foreach ($source->childNodes as $node) { - if ($node->nodeType == XML_ELEMENT_NODE) { + if ($node->nodeType == XML_ELEMENT_NODE && $node->getAttribute('remove') != 'true') { $nodeName = $node->nodeName; $nodePath = $basePath . '/' . $nodeName; diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php index 42b4b1d4e..11c0f05df 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php @@ -68,7 +68,7 @@ public function __construct($name, $arguments, $actions) */ public function getSteps($arguments, $actionReferenceKey) { - $mergeUtil = new ActionMergeUtil(); + $mergeUtil = new ActionMergeUtil($this->name, "ActionGroup"); $args = $this->arguments; if ($arguments) { @@ -118,11 +118,14 @@ private function getResolvedActionsWithArgs($arguments, $actionReferenceKey) ); } } + + // we append the action reference key to any linked action and the action's merge key as the user might + // use this action group multiple times in the same test. $resolvedActions[$action->getMergeKey() . $actionReferenceKey] = new ActionObject( $action->getMergeKey() . $actionReferenceKey, $action->getType(), array_merge($action->getCustomActionAttributes(), $newActionAttributes), - $action->getLinkedAction(), + $action->getLinkedAction() == null ? null : $action->getLinkedAction() . $actionReferenceKey, $action->getOrderOffset() ); } diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/CestHookObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/CestHookObject.php index 7d62b32ec..32f77e3ae 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/CestHookObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/CestHookObject.php @@ -20,6 +20,13 @@ class CestHookObject */ private $type; + /** + * Name of parent object + * + * @var string + */ + private $parentName; + /** * Array which contains the action objects to be executed in a hook. * @@ -36,12 +43,14 @@ class CestHookObject /** * CestHookObject constructor. * @param string $type + * @param string $parentName * @param array $actions * @param array $customData */ - public function __construct($type, $actions, $customData = null) + public function __construct($type, $parentName, $actions, $customData = null) { $this->type = $type; + $this->cestNameparent = $parentName; $this->actions = $actions; $this->customData = $customData; } @@ -63,7 +72,7 @@ public function getType() */ public function getActions() { - $mergeUtil = new ActionMergeUtil(); + $mergeUtil = new ActionMergeUtil($this->parentName, $this->getType()); return $mergeUtil->resolveActionSteps($this->actions); } diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php index 6ccf23172..a45861d00 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/TestObject.php @@ -109,7 +109,7 @@ public function getCustomData() */ public function getOrderedActions() { - $mergeUtil = new ActionMergeUtil(); + $mergeUtil = new ActionMergeUtil($this->getName(), "Test"); return $mergeUtil->resolveActionSteps($this->parsedSteps); } } diff --git a/src/Magento/FunctionalTestingFramework/Test/Util/ActionMergeUtil.php b/src/Magento/FunctionalTestingFramework/Test/Util/ActionMergeUtil.php index f90b70ca5..e1035a867 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Util/ActionMergeUtil.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/ActionMergeUtil.php @@ -18,7 +18,7 @@ class ActionMergeUtil { const STEP_MISSING_ERROR_MSG = "Merge Error - Step could not be found in either TestXML or DeltaXML. - \tTest = '%s'\tTestStep='%s'\tLinkedStep'%s'"; + \t%s = '%s'\tTestStep='%s'\tLinkedStep'%s'"; const WAIT_ATTR = 'timeout'; const WAIT_ACTION_NAME = 'waitForPageLoad'; @@ -39,12 +39,30 @@ class ActionMergeUtil */ private $stepsToMerge = []; + /** + * Name of calling context. + * + * @var string + */ + private $name; + + /** + * Type of calling context. + * + * @var string + */ + private $type; + /** * ActionMergeUtil constructor. + * + * @param string $contextName + * @param string $contextType */ - public function __construct() + public function __construct($contextName, $contextType) { - // empty constructor + $this->name = $contextName; + $this->type = $contextType; } /** @@ -172,7 +190,8 @@ private function mergeAction($stepToMerge) !array_key_exists($linkedStep, $this->stepsToMerge)) { throw new XmlException(sprintf( self::STEP_MISSING_ERROR_MSG, - $this->getName(), + $this->type, + $this->name, $stepToMerge->getMergeKey(), $linkedStep )); diff --git a/src/Magento/FunctionalTestingFramework/Test/Util/CestHookObjectExtractor.php b/src/Magento/FunctionalTestingFramework/Test/Util/CestHookObjectExtractor.php index 47fb15fe5..0c172656a 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Util/CestHookObjectExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/CestHookObjectExtractor.php @@ -40,11 +40,12 @@ public function __construct() * This method trims all irrelevant tags to extract hook information including before and after tags * and their relevant actions. The result is an array of CestHookObjects. * + * @param string $parentName * @param string $hookType * @param array $cestHook * @return CestHookObject */ - public function extractHook($hookType, $cestHook) + public function extractHook($parentName, $hookType, $cestHook) { $hookActions = $this->stripDescriptorTags( $cestHook, @@ -53,6 +54,7 @@ public function extractHook($hookType, $cestHook) $hook = new CestHookObject( $hookType, + $parentName, $this->actionObjectExtractor->extractActions($hookActions), $this->testEntityExtractor->extractTestEntities($hookActions) ); diff --git a/src/Magento/FunctionalTestingFramework/Test/Util/CestObjectExtractor.php b/src/Magento/FunctionalTestingFramework/Test/Util/CestObjectExtractor.php index 7582d520e..445e9c642 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Util/CestObjectExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/CestObjectExtractor.php @@ -50,6 +50,7 @@ public function extractCest($cestData) if (array_key_exists(self::CEST_BEFORE_HOOK, $cestData)) { $hooks[self::CEST_BEFORE_HOOK] = $cestHookObjectExtractor->extractHook( + $cestData[self::NAME], self::CEST_BEFORE_HOOK, $cestData[self::CEST_BEFORE_HOOK] ); @@ -59,6 +60,7 @@ public function extractCest($cestData) if (array_key_exists(self::CEST_AFTER_HOOK, $cestData)) { $hooks[self::CEST_AFTER_HOOK] = $cestHookObjectExtractor->extractHook( + $cestData[self::NAME], self::CEST_AFTER_HOOK, $cestData[self::CEST_AFTER_HOOK] ); From a5e371d34a4435cfb302812e722aa323a23fe825 Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@magento.com> Date: Mon, 6 Nov 2017 11:18:52 -0600 Subject: [PATCH 20/23] MQE-521: Remove composer.lock from framework --- composer.lock | 2713 ------------------------------------------------- 1 file changed, 2713 deletions(-) delete mode 100644 composer.lock diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 60d4dc14f..000000000 --- a/composer.lock +++ /dev/null @@ -1,2713 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "content-hash": "6a845d91aa6c99cce577f96862648392", - "packages": [ - { - "name": "behat/gherkin", - "version": "v4.4.5", - "source": { - "type": "git", - "url": "https://github.com/Behat/Gherkin.git", - "reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/5c14cff4f955b17d20d088dec1bde61c0539ec74", - "reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74", - "shasum": "" - }, - "require": { - "php": ">=5.3.1" - }, - "require-dev": { - "phpunit/phpunit": "~4.5|~5", - "symfony/phpunit-bridge": "~2.7|~3", - "symfony/yaml": "~2.3|~3" - }, - "suggest": { - "symfony/yaml": "If you want to parse features, represented in YAML files" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, - "autoload": { - "psr-0": { - "Behat\\Gherkin": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Gherkin DSL parser for PHP 5.3", - "homepage": "http://behat.org/", - "keywords": [ - "BDD", - "Behat", - "Cucumber", - "DSL", - "gherkin", - "parser" - ], - "time": "2016-10-30T11:50:56+00:00" - }, - { - "name": "codeception/codeception", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/Codeception/Codeception.git", - "reference": "b54eaf4007484f36145c1dc8c64da1874adbc340" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/b54eaf4007484f36145c1dc8c64da1874adbc340", - "reference": "b54eaf4007484f36145c1dc8c64da1874adbc340", - "shasum": "" - }, - "require": { - "behat/gherkin": "~4.4.0", - "ext-json": "*", - "ext-mbstring": "*", - "facebook/webdriver": ">=1.0.1 <2.0", - "guzzlehttp/guzzle": ">=4.1.4 <7.0", - "guzzlehttp/psr7": "~1.0", - "php": ">=5.4.0 <8.0", - "phpunit/php-code-coverage": ">=2.2.4 <6.0", - "phpunit/phpunit": ">4.8.20 <6.0", - "phpunit/phpunit-mock-objects": ">2.3 <5.0", - "sebastian/comparator": ">1.1 <3.0", - "sebastian/diff": "^1.4", - "stecman/symfony-console-completion": "^0.7.0", - "symfony/browser-kit": ">=2.7 <4.0", - "symfony/console": ">=2.7 <4.0", - "symfony/css-selector": ">=2.7 <4.0", - "symfony/dom-crawler": ">=2.7.5 <4.0", - "symfony/event-dispatcher": ">=2.7 <4.0", - "symfony/finder": ">=2.7 <4.0", - "symfony/yaml": ">=2.7 <4.0" - }, - "require-dev": { - "codeception/specify": "~0.3", - "facebook/graph-sdk": "~5.3", - "flow/jsonpath": "~0.2", - "league/factory-muffin": "^3.0", - "league/factory-muffin-faker": "^1.0", - "mongodb/mongodb": "^1.0", - "monolog/monolog": "~1.8", - "pda/pheanstalk": "~3.0", - "php-amqplib/php-amqplib": "~2.4", - "predis/predis": "^1.0", - "squizlabs/php_codesniffer": "~2.0", - "vlucas/phpdotenv": "^2.4.0" - }, - "suggest": { - "codeception/specify": "BDD-style code blocks", - "codeception/verify": "BDD-style assertions", - "flow/jsonpath": "For using JSONPath in REST module", - "league/factory-muffin": "For DataFactory module", - "league/factory-muffin-faker": "For Faker support in DataFactory module", - "phpseclib/phpseclib": "for SFTP option in FTP Module", - "symfony/phpunit-bridge": "For phpunit-bridge support" - }, - "bin": [ - "codecept" - ], - "type": "library", - "extra": { - "branch-alias": [] - }, - "autoload": { - "psr-4": { - "Codeception\\": "src\\Codeception", - "Codeception\\Extension\\": "ext" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Bodnarchuk", - "email": "davert@mail.ua", - "homepage": "http://codegyre.com" - } - ], - "description": "BDD-style testing framework", - "homepage": "http://codeception.com/", - "keywords": [ - "BDD", - "TDD", - "acceptance testing", - "functional testing", - "unit testing" - ], - "time": "2017-05-22T23:47:35+00:00" - }, - { - "name": "doctrine/instantiator", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "^6.2.3", - "squizlabs/php_codesniffer": "^3.0.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2017-07-22T11:58:36+00:00" - }, - { - "name": "facebook/webdriver", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/facebook/php-webdriver.git", - "reference": "eadb0b7a7c3e6578185197fd40158b08c3164c83" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/eadb0b7a7c3e6578185197fd40158b08c3164c83", - "reference": "eadb0b7a7c3e6578185197fd40158b08c3164c83", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-zip": "*", - "php": "^5.5 || ~7.0", - "symfony/process": "^2.8 || ^3.1" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.0", - "php-mock/php-mock-phpunit": "^1.1", - "phpunit/phpunit": "4.6.* || ~5.0", - "satooshi/php-coveralls": "^1.0", - "squizlabs/php_codesniffer": "^2.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-community": "1.5-dev" - } - }, - "autoload": { - "psr-4": { - "Facebook\\WebDriver\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "description": "A PHP client for Selenium WebDriver", - "homepage": "https://github.com/facebook/php-webdriver", - "keywords": [ - "facebook", - "php", - "selenium", - "webdriver" - ], - "time": "2017-04-28T14:54:49+00:00" - }, - { - "name": "flow/jsonpath", - "version": "0.3.4", - "source": { - "type": "git", - "url": "https://github.com/FlowCommunications/JSONPath.git", - "reference": "00aa9c361e4d0a210dd95f3c917a1e0dde3a957f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FlowCommunications/JSONPath/zipball/00aa9c361e4d0a210dd95f3c917a1e0dde3a957f", - "reference": "00aa9c361e4d0a210dd95f3c917a1e0dde3a957f", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "peekmo/jsonpath": "dev-master", - "phpunit/phpunit": "^4.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "Flow\\JSONPath": "src/", - "Flow\\JSONPath\\Test": "tests/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Stephen Frank", - "email": "stephen@flowsa.com" - } - ], - "description": "JSONPath implementation for parsing, searching and flattening arrays", - "time": "2016-09-06T17:43:18+00:00" - }, - { - "name": "fzaninotto/faker", - "version": "v1.7.1", - "source": { - "type": "git", - "url": "https://github.com/fzaninotto/Faker.git", - "reference": "d3ed4cc37051c1ca52d22d76b437d14809fc7e0d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/d3ed4cc37051c1ca52d22d76b437d14809fc7e0d", - "reference": "d3ed4cc37051c1ca52d22d76b437d14809fc7e0d", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "ext-intl": "*", - "phpunit/phpunit": "^4.0 || ^5.0", - "squizlabs/php_codesniffer": "^1.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8-dev" - } - }, - "autoload": { - "psr-4": { - "Faker\\": "src/Faker/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "François Zaninotto" - } - ], - "description": "Faker is a PHP library that generates fake data for you.", - "keywords": [ - "data", - "faker", - "fixtures" - ], - "time": "2017-08-15T16:48:10+00:00" - }, - { - "name": "guzzlehttp/guzzle", - "version": "6.3.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", - "shasum": "" - }, - "require": { - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4", - "php": ">=5.5" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.0 || ^5.0", - "psr/log": "^1.0" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.2-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2017-06-22T18:50:49+00:00" - }, - { - "name": "guzzlehttp/promises", - "version": "v1.3.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "time": "2016-12-20T10:07:11+00:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "request", - "response", - "stream", - "uri", - "url" - ], - "time": "2017-03-20T17:10:46+00:00" - }, - { - "name": "mustache/mustache", - "version": "v2.12.0", - "source": { - "type": "git", - "url": "https://github.com/bobthecow/mustache.php.git", - "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/fe8fe72e9d580591854de404cc59a1b83ca4d19e", - "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e", - "shasum": "" - }, - "require": { - "php": ">=5.2.4" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~1.11", - "phpunit/phpunit": "~3.7|~4.0|~5.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "Mustache": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Justin Hileman", - "email": "justin@justinhileman.info", - "homepage": "http://justinhileman.com" - } - ], - "description": "A Mustache implementation in PHP.", - "homepage": "https://github.com/bobthecow/mustache.php", - "keywords": [ - "mustache", - "templating" - ], - "time": "2017-07-11T12:54:05+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.6.1", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8e6e04167378abf1ddb4d3522d8755c5fd90d102", - "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "doctrine/collections": "1.*", - "phpunit/phpunit": "~4.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "homepage": "https://github.com/myclabs/DeepCopy", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "time": "2017-04-12T18:52:22+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "^4.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "time": "2017-09-11T18:02:19+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "4.1.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/2d3d238c433cf69caeb4842e97a3223a116f94b2", - "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2", - "shasum": "" - }, - "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.4.0", - "webmozart/assert": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-08-30T18:51:59+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "0.4.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", - "shasum": "" - }, - "require": { - "php": "^5.5 || ^7.0", - "phpdocumentor/reflection-common": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "time": "2017-07-14T14:27:02+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.7.2", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", - "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8 || ^5.6.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7.x-dev" - } - }, - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2017-09-04T11:05:03+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "4.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "^1.3", - "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.2 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "^1.0 || ^2.0" - }, - "require-dev": { - "ext-xdebug": "^2.1.4", - "phpunit/phpunit": "^5.7" - }, - "suggest": { - "ext-xdebug": "^2.5.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2017-04-02T07:44:40+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2016-10-03T07:40:28+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.9", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2017-02-26T11:10:40+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9a02332089ac48e704c70f6cefed30c224e3c0b0", - "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.2.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2017-08-20T05:47:52+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "5.7.23", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "78532d5269d984660080d8e0f4c99c5c2ea65ffe" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/78532d5269d984660080d8e0f4c99c5c2ea65ffe", - "reference": "78532d5269d984660080d8e0f4c99c5c2ea65ffe", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.6.2", - "phpunit/php-code-coverage": "^4.0.4", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "^1.2.4", - "sebastian/diff": "^1.4.3", - "sebastian/environment": "^1.3.4 || ^2.0", - "sebastian/exporter": "~2.0", - "sebastian/global-state": "^1.1", - "sebastian/object-enumerator": "~2.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "~1.0.3|~2.0", - "symfony/yaml": "~2.1|~3.0" - }, - "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-xdebug": "*", - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.7.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2017-10-15T06:13:55+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "3.4.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2 || ^2.0" - }, - "conflict": { - "phpunit/phpunit": "<5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.4" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2017-06-30T09:13:00+00:00" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "psr/log", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2016-10-10T12:19:37+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" - }, - { - "name": "sebastian/comparator", - "version": "1.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2017-01-29T09:50:25+00:00" - }, - { - "name": "sebastian/diff", - "version": "1.4.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2017-05-22T07:24:03+00:00" - }, - { - "name": "sebastian/environment", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2016-11-26T07:53:53+00:00" - }, - { - "name": "sebastian/exporter", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2016-11-19T08:54:04+00:00" - }, - { - "name": "sebastian/global-state", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2015-10-12T03:26:01+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", - "shasum": "" - }, - "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18T15:18:39+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19T07:33:16+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "shasum": "" - }, - "require": { - "php": ">=5.6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" - }, - { - "name": "sebastian/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" - }, - { - "name": "stecman/symfony-console-completion", - "version": "0.7.0", - "source": { - "type": "git", - "url": "https://github.com/stecman/symfony-console-completion.git", - "reference": "5461d43e53092b3d3b9dbd9d999f2054730f4bbb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/stecman/symfony-console-completion/zipball/5461d43e53092b3d3b9dbd9d999f2054730f4bbb", - "reference": "5461d43e53092b3d3b9dbd9d999f2054730f4bbb", - "shasum": "" - }, - "require": { - "php": ">=5.3.2", - "symfony/console": "~2.3 || ~3.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.6.x-dev" - } - }, - "autoload": { - "psr-4": { - "Stecman\\Component\\Symfony\\Console\\BashCompletion\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Stephen Holdaway", - "email": "stephen@stecman.co.nz" - } - ], - "description": "Automatic BASH completion for Symfony Console Component based applications.", - "time": "2016-02-24T05:08:54+00:00" - }, - { - "name": "symfony/browser-kit", - "version": "v3.3.10", - "source": { - "type": "git", - "url": "https://github.com/symfony/browser-kit.git", - "reference": "317d5bdf0127f06db7ea294186132b4f5b036839" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/317d5bdf0127f06db7ea294186132b4f5b036839", - "reference": "317d5bdf0127f06db7ea294186132b4f5b036839", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/dom-crawler": "~2.8|~3.0" - }, - "require-dev": { - "symfony/css-selector": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0" - }, - "suggest": { - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\BrowserKit\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony BrowserKit Component", - "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" - }, - { - "name": "symfony/console", - "version": "v3.3.10", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "116bc56e45a8e5572e51eb43ab58c769a352366c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/116bc56e45a8e5572e51eb43ab58c769a352366c", - "reference": "116bc56e45a8e5572e51eb43ab58c769a352366c", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/dependency-injection": "<3.3" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~3.3", - "symfony/dependency-injection": "~3.3", - "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/filesystem": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/filesystem": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" - }, - { - "name": "symfony/css-selector", - "version": "v3.3.10", - "source": { - "type": "git", - "url": "https://github.com/symfony/css-selector.git", - "reference": "07447650225ca9223bd5c97180fe7c8267f7d332" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/07447650225ca9223bd5c97180fe7c8267f7d332", - "reference": "07447650225ca9223bd5c97180fe7c8267f7d332", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\CssSelector\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony CssSelector Component", - "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" - }, - { - "name": "symfony/debug", - "version": "v3.3.10", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd", - "reference": "eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" - }, - "require-dev": { - "symfony/http-kernel": "~2.8|~3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Debug Component", - "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" - }, - { - "name": "symfony/dom-crawler", - "version": "v3.3.10", - "source": { - "type": "git", - "url": "https://github.com/symfony/dom-crawler.git", - "reference": "40dafd42d5dad7fe5ad4e958413d92a207522ac1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/40dafd42d5dad7fe5ad4e958413d92a207522ac1", - "reference": "40dafd42d5dad7fe5ad4e958413d92a207522ac1", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "symfony/css-selector": "~2.8|~3.0" - }, - "suggest": { - "symfony/css-selector": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\DomCrawler\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony DomCrawler Component", - "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" - }, - { - "name": "symfony/event-dispatcher", - "version": "v3.3.10", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "d7ba037e4b8221956ab1e221c73c9e27e05dd423" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d7ba037e4b8221956ab1e221c73c9e27e05dd423", - "reference": "d7ba037e4b8221956ab1e221c73c9e27e05dd423", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "conflict": { - "symfony/dependency-injection": "<3.3" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0", - "symfony/dependency-injection": "~3.3", - "symfony/expression-language": "~2.8|~3.0", - "symfony/stopwatch": "~2.8|~3.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" - }, - { - "name": "symfony/finder", - "version": "v3.3.10", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "773e19a491d97926f236942484cb541560ce862d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/773e19a491d97926f236942484cb541560ce862d", - "reference": "773e19a491d97926f236942484cb541560ce862d", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.6.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", - "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2017-10-11T12:05:26+00:00" - }, - { - "name": "symfony/process", - "version": "v3.3.10", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "fdf89e57a723a29baf536e288d6e232c059697b1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/fdf89e57a723a29baf536e288d6e232c059697b1", - "reference": "fdf89e57a723a29baf536e288d6e232c059697b1", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" - }, - { - "name": "symfony/yaml", - "version": "v3.3.10", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46", - "reference": "8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "require-dev": { - "symfony/console": "~2.8|~3.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2017-10-05T14:43:42+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "time": "2016-11-23T20:04:58+00:00" - } - ], - "packages-dev": [ - { - "name": "sebastian/finder-facade", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/finder-facade.git", - "reference": "2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9", - "reference": "2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9", - "shasum": "" - }, - "require": { - "symfony/finder": "~2.3|~3.0", - "theseer/fdomdocument": "~1.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FinderFacade is a convenience wrapper for Symfony's Finder component.", - "homepage": "https://github.com/sebastianbergmann/finder-facade", - "time": "2016-02-17T07:02:23+00:00" - }, - { - "name": "sebastian/phpcpd", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpcpd.git", - "reference": "d7006078b75a34c9250831c3453a2e256a687615" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpcpd/zipball/d7006078b75a34c9250831c3453a2e256a687615", - "reference": "d7006078b75a34c9250831c3453a2e256a687615", - "shasum": "" - }, - "require": { - "php": "^5.6|^7.0", - "phpunit/php-timer": "^1.0.6", - "sebastian/finder-facade": "^1.1", - "sebastian/version": "^2.0", - "symfony/console": "^3.0" - }, - "bin": [ - "phpcpd" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Copy/Paste Detector (CPD) for PHP code.", - "homepage": "https://github.com/sebastianbergmann/phpcpd", - "time": "2017-02-05T07:48:01+00:00" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "1.5.3", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "396178ada8499ec492363587f037125bf7b07fcc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/396178ada8499ec492363587f037125bf7b07fcc", - "reference": "396178ada8499ec492363587f037125bf7b07fcc", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.1.2" - }, - "suggest": { - "phpunit/php-timer": "dev-master" - }, - "bin": [ - "scripts/phpcs" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-phpcs-fixer": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "CodeSniffer.php", - "CodeSniffer/CLI.php", - "CodeSniffer/Exception.php", - "CodeSniffer/File.php", - "CodeSniffer/Report.php", - "CodeSniffer/Reporting.php", - "CodeSniffer/Sniff.php", - "CodeSniffer/Tokens.php", - "CodeSniffer/Reports/", - "CodeSniffer/CommentParser/", - "CodeSniffer/Tokenizers/", - "CodeSniffer/DocGenerators/", - "CodeSniffer/Standards/AbstractPatternSniff.php", - "CodeSniffer/Standards/AbstractScopeSniff.php", - "CodeSniffer/Standards/AbstractVariableSniff.php", - "CodeSniffer/Standards/IncorrectPatternException.php", - "CodeSniffer/Standards/Generic/Sniffs/", - "CodeSniffer/Standards/MySource/Sniffs/", - "CodeSniffer/Standards/PEAR/Sniffs/", - "CodeSniffer/Standards/PSR1/Sniffs/", - "CodeSniffer/Standards/PSR2/Sniffs/", - "CodeSniffer/Standards/Squiz/Sniffs/", - "CodeSniffer/Standards/Zend/Sniffs/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenises PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", - "keywords": [ - "phpcs", - "standards" - ], - "time": "2014-05-01T03:07:07+00:00" - }, - { - "name": "theseer/fdomdocument", - "version": "1.6.6", - "source": { - "type": "git", - "url": "https://github.com/theseer/fDOMDocument.git", - "reference": "6e8203e40a32a9c770bcb62fe37e68b948da6dca" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/fDOMDocument/zipball/6e8203e40a32a9c770bcb62fe37e68b948da6dca", - "reference": "6e8203e40a32a9c770bcb62fe37e68b948da6dca", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "lib-libxml": "*", - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "lead" - } - ], - "description": "The classes contained within this repository extend the standard DOM to use exceptions at all occasions of errors instead of PHP warnings or notices. They also add various custom methods and shortcuts for convenience and to simplify the usage of DOM.", - "homepage": "https://github.com/theseer/fDOMDocument", - "time": "2017-06-30T11:53:12+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": "~7.0" - }, - "platform-dev": [] -} From 6d28b2162bc7af08451db8f8cfe65354ebc290a7 Mon Sep 17 00:00:00 2001 From: Ji Lu <jilu1@magento.com> Date: Mon, 6 Nov 2017 12:29:53 -0600 Subject: [PATCH 21/23] MQE-522: Fixed warnings for length has to be greater than zero for substr_count() when using php < 7.1. --- .../FunctionalTestingFramework/Util/TestGenerator.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 9fec5d0dd..2108627aa 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -980,9 +980,13 @@ private function processQuoteBreaks($match, $argument, $replacement) $beforeIndex = strpos($outputArg, $match) - 1; $afterIndex = $beforeIndex + strlen($match) + 1; + $quoteBefore = false; // Determine if there is a " before/after the $match, and if there is only one " before/after match. - $quoteBefore = $argument[$beforeIndex] == '"' && substr_count($argument, '"', 0, $beforeIndex)<1; - $quoteAfter = $argument[$afterIndex] == '"' && substr_count($argument, '"', $afterIndex+1)<1; + if ($beforeIndex == 0 + || ($argument[$beforeIndex] == '"' && substr_count($argument, '"', 0, $beforeIndex) < 1)) { + $quoteBefore = true; + } + $quoteAfter = $argument[$afterIndex] == '"' && substr_count($argument, '"', $afterIndex+1) < 1; //Remove quotes at either end of argument if they aren't necessary. Add double-quote concatenation if needed. if ($quoteBefore) { From 19def8a983781b51b2dfc151e8c2bdf93875d26b Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@magento.com> Date: Tue, 7 Nov 2017 10:59:38 -0600 Subject: [PATCH 22/23] MQE-523: Create mainline PRs for previous sprint (12) - Fix Alex's feedback --- dev/_suite/functionalSuite.xml | 8 ++--- .../Resources/ActionGroupFunctionalCest.txt | 8 ++--- .../Resources/PersistedReplacementCest.txt | 12 +++---- .../Resources/testSuiteGeneration1.txt | 8 ++--- .../ActionGroup/functionalActionGroup.xml | 10 +++--- .../mergeFunctionalActionGroup.xml | 4 +-- .../Cest/actionGroupFunctionalCest.xml | 32 +++++++++---------- .../Cest/mergeBaseFunctionalCest.xml | 6 ++-- .../TestModule/Cest/mergeInFunctionalCest.xml | 6 ++-- .../Cest/persistedReplacementCest.xml | 10 +++--- .../TestModule/Cest/sampleSuiteCest.xml | 22 ++++++------- .../Data/persistedReplacementData.xml | 6 ++-- .../Data/persistedReplacementMergeData.xml | 2 +- .../TestModule/Section/zMergeSection.xml | 2 +- .../Tests/ActionGroupMergeGenerationTest.php | 10 +++++- .../Persist/OperationDataArrayResolver.php | 2 +- .../Suite/etc/sampleSuite.xml | 2 +- .../MetadataGenerator/MetadataGenUtil.php | 27 ++++++---------- .../views/operation.mustache | 2 +- .../views/partials/object.mustache | 2 +- 20 files changed, 90 insertions(+), 91 deletions(-) diff --git a/dev/_suite/functionalSuite.xml b/dev/_suite/functionalSuite.xml index 62f97fdc7..ae372cf00 100644 --- a/dev/_suite/functionalSuite.xml +++ b/dev/_suite/functionalSuite.xml @@ -10,12 +10,12 @@ <suite name="functionalSuite1"> <include> <group name="include"/> - <cest name="sampleSuiteCest" test="includeTest"/> - <cest name="sampleSuite4Cest"/> + <cest name="SampleSuiteCest" test="IncludeTest"/> + <cest name="SampleSuite4Cest"/> </include> <exclude> <group name="exclude"/> - <cest name="sampleSuite5Cest" test="excludeTest"/> + <cest name="SampleSuite5Cest" test="ExcludeTest"/> </exclude> </suite> -</suites> \ No newline at end of file +</suites> diff --git a/dev/tests/verification/Resources/ActionGroupFunctionalCest.txt b/dev/tests/verification/Resources/ActionGroupFunctionalCest.txt index 5ede1b222..a2b40ac98 100644 --- a/dev/tests/verification/Resources/ActionGroupFunctionalCest.txt +++ b/dev/tests/verification/Resources/ActionGroupFunctionalCest.txt @@ -31,8 +31,8 @@ class ActionGroupFunctionalCest public function _before(AcceptanceTester $I) { $I->amGoingTo("create entity that has the mergeKey: createPersonParam"); - $replacementPerson = DataObjectHandler::getInstance()->getObject("replacementPerson"); - $this->createPersonParam = new DataPersistenceHandler($replacementPerson); + $ReplacementPerson = DataObjectHandler::getInstance()->getObject("ReplacementPerson"); + $this->createPersonParam = new DataPersistenceHandler($ReplacementPerson); $this->createPersonParam->createEntity(); } @@ -103,8 +103,8 @@ class ActionGroupFunctionalCest public function ActionGroupWithPersistedData(AcceptanceTester $I) { $I->amGoingTo("create entity that has the mergeKey: createPerson"); - $defaultPerson = DataObjectHandler::getInstance()->getObject("defaultPerson"); - $createPerson = new DataPersistenceHandler($defaultPerson); + $DefaultPerson = DataObjectHandler::getInstance()->getObject("DefaultPerson"); + $createPerson = new DataPersistenceHandler($DefaultPerson); $createPerson->createEntity(); $I->amOnPage("/" . $createPerson->getCreatedDataByName('firstname') . "/" . $createPerson->getCreatedDataByName('lastname') . ".html"); $I->fillField("#foo", $createPerson->getCreatedDataByName('firstname')); diff --git a/dev/tests/verification/Resources/PersistedReplacementCest.txt b/dev/tests/verification/Resources/PersistedReplacementCest.txt index 3ef3379cf..d52b74930 100644 --- a/dev/tests/verification/Resources/PersistedReplacementCest.txt +++ b/dev/tests/verification/Resources/PersistedReplacementCest.txt @@ -26,8 +26,8 @@ class PersistedReplacementCest public function _before(AcceptanceTester $I) { $I->amGoingTo("create entity that has the mergeKey: createData1"); - $replacementPerson = DataObjectHandler::getInstance()->getObject("replacementPerson"); - $this->createData1 = new DataPersistenceHandler($replacementPerson); + $ReplacementPerson = DataObjectHandler::getInstance()->getObject("ReplacementPerson"); + $this->createData1 = new DataPersistenceHandler($ReplacementPerson); $this->createData1->createEntity(); } @@ -39,12 +39,12 @@ class PersistedReplacementCest public function PersistedReplacementTest(AcceptanceTester $I) { $I->amGoingTo("create entity that has the mergeKey: testScopeData"); - $replacementPerson = DataObjectHandler::getInstance()->getObject("replacementPerson"); - $testScopeData = new DataPersistenceHandler($replacementPerson); + $ReplacementPerson = DataObjectHandler::getInstance()->getObject("ReplacementPerson"); + $testScopeData = new DataPersistenceHandler($ReplacementPerson); $testScopeData->createEntity(); $I->amGoingTo("create entity that has the mergeKey: uniqueData"); - $uniquePerson = DataObjectHandler::getInstance()->getObject("uniquePerson"); - $uniqueData = new DataPersistenceHandler($uniquePerson); + $UniquePerson = DataObjectHandler::getInstance()->getObject("UniquePerson"); + $uniqueData = new DataPersistenceHandler($UniquePerson); $uniqueData->createEntity(); $I->amOnPage("/success/success2.html"); $I->amOnPage($testScopeData->getCreatedDataByName('firstname') . ".html"); diff --git a/dev/tests/verification/Resources/testSuiteGeneration1.txt b/dev/tests/verification/Resources/testSuiteGeneration1.txt index 7b2da7836..620dacd7e 100644 --- a/dev/tests/verification/Resources/testSuiteGeneration1.txt +++ b/dev/tests/verification/Resources/testSuiteGeneration1.txt @@ -1,4 +1,4 @@ -dev/tests/verification/_generated/functionalSuite1/sampleSuite3Cest.php:includeTest -dev/tests/verification/_generated/functionalSuite1/sampleSuite5Cest.php:additionalTest -dev/tests/verification/_generated/functionalSuite1/sampleSuiteCest.php:includeTest -dev/tests/verification/_generated/functionalSuite1/sampleSuite4Cest.php:includeTest +dev/tests/verification/_generated/functionalSuite1/SampleSuite3Cest.php:IncludeTest +dev/tests/verification/_generated/functionalSuite1/SampleSuite5Cest.php:additionalTest +dev/tests/verification/_generated/functionalSuite1/SampleSuiteCest.php:IncludeTest +dev/tests/verification/_generated/functionalSuite1/SampleSuite4Cest.php:IncludeTest diff --git a/dev/tests/verification/TestModule/ActionGroup/functionalActionGroup.xml b/dev/tests/verification/TestModule/ActionGroup/functionalActionGroup.xml index e9ce573e0..a4b1e4cd6 100644 --- a/dev/tests/verification/TestModule/ActionGroup/functionalActionGroup.xml +++ b/dev/tests/verification/TestModule/ActionGroup/functionalActionGroup.xml @@ -8,13 +8,13 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> - <actionGroup name="functionalActionGroup"> + <actionGroup name="FunctionalActionGroup"> <fillField selector="#foo" userInput="myData1" mergeKey="fillField1"/> <fillField selector="#bar" userInput="myData2" mergeKey="fillField2"/> </actionGroup> - <actionGroup name="functionalActionGroupWithData"> + <actionGroup name="FunctionalActionGroupWithData"> <arguments> - <argument name="person" defaultValue="defaultPerson"/> + <argument name="person" defaultValue="DefaultPerson"/> </arguments> <amOnPage url="{{SamplePage.url(person.firstname,person.lastname)}}" mergeKey="amOnPage1"/> <fillField selector="#foo" userInput="{{person.firstname}}" mergeKey="fillField1"/> @@ -22,7 +22,7 @@ <searchAndMultiSelectOption selector="#foo" parameterArray="[{{person.firstname}}, {{person.lastname}}]" mergeKey="multi1"/> <see selector="{{SampleSection.oneParamElement(person.firstname)}}" mergeKey="see1"/> </actionGroup> - <actionGroup name="functionalActionGroupNoDefault"> + <actionGroup name="FunctionalActionGroupNoDefault"> <arguments> <argument name="person"/> </arguments> @@ -30,7 +30,7 @@ <fillField selector="#bar" userInput="{{person.lastname}}" mergeKey="fillField2"/> <see selector="{{SampleSection.twoParamElement(person.firstname,person.lastname)}}" mergeKey="see2"/> </actionGroup> - <actionGroup name="functionalActionGroupForMerge"> + <actionGroup name="FunctionalActionGroupForMerge"> <arguments> <argument name="myArg"/> </arguments> diff --git a/dev/tests/verification/TestModule/ActionGroup/mergeFunctionalActionGroup.xml b/dev/tests/verification/TestModule/ActionGroup/mergeFunctionalActionGroup.xml index a1a8cd089..37f648f43 100644 --- a/dev/tests/verification/TestModule/ActionGroup/mergeFunctionalActionGroup.xml +++ b/dev/tests/verification/TestModule/ActionGroup/mergeFunctionalActionGroup.xml @@ -8,9 +8,9 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> - <actionGroup name="functionalActionGroupForMerge"> + <actionGroup name="FunctionalActionGroupForMerge"> <see mergeKey="myMergedSeeElement" selector=".merge .{{myArg.firstname}}" before="see1"/> <click mergeKey="myMergedClick" selector=".merge .{{myArg.lastname}}" after="amOnPage1"/> <fillField mergeKey="deleteMe" remove="true"/> </actionGroup> -</config> \ No newline at end of file +</config> diff --git a/dev/tests/verification/TestModule/Cest/actionGroupFunctionalCest.xml b/dev/tests/verification/TestModule/Cest/actionGroupFunctionalCest.xml index abbe6f71a..2237853f3 100644 --- a/dev/tests/verification/TestModule/Cest/actionGroupFunctionalCest.xml +++ b/dev/tests/verification/TestModule/Cest/actionGroupFunctionalCest.xml @@ -17,55 +17,55 @@ <stories value="MQE-433"/> </annotations> <before> - <createData entity="replacementPerson" mergeKey="createPersonParam"/> + <createData entity="ReplacementPerson" mergeKey="createPersonParam"/> </before> <test name="BasicActionGroupTest"> <amOnPage mergeKey="step1" url="/someUrl"/> - <actionGroup ref="functionalActionGroup" mergeKey="actionGroup1"/> + <actionGroup ref="FunctionalActionGroup" mergeKey="actionGroup1"/> <click mergeKey="step6" selector="loginButton"/> </test> <test name="ActionGroupWithDataTest"> <amOnPage mergeKey="step1" url="/someUrl"/> - <actionGroup ref="functionalActionGroupWithData" mergeKey="actionGroupWithData1"/> + <actionGroup ref="FunctionalActionGroupWithData" mergeKey="actionGroupWithData1"/> <click mergeKey="step6" selector="loginButton"/> </test> <test name="ActionGroupWithDataOverrideTest"> <amOnPage mergeKey="step1" url="/someUrl"/> - <actionGroup ref="functionalActionGroupWithData" mergeKey="actionGroupWithDataOverride1"> - <argument name="person" value="replacementPerson"/> + <actionGroup ref="FunctionalActionGroupWithData" mergeKey="actionGroupWithDataOverride1"> + <argument name="person" value="ReplacementPerson"/> </actionGroup> <click mergeKey="step6" selector="loginButton"/> </test> <test name="ActionGroupWithNoDefaultTest"> <amOnPage mergeKey="step1" url="/someUrl"/> - <actionGroup ref="functionalActionGroupNoDefault" mergeKey="actionGroupWithDataOverride1"> - <argument name="person" value="defaultPerson"/> + <actionGroup ref="FunctionalActionGroupNoDefault" mergeKey="actionGroupWithDataOverride1"> + <argument name="person" value="DefaultPerson"/> </actionGroup> <click mergeKey="step6" selector="loginButton"/> </test> <test name="ActionGroupWithPersistedData"> - <createData entity="defaultPerson" mergeKey="createPerson"/> - <actionGroup ref="functionalActionGroupWithData" mergeKey="actionGroupWithPersistedData1"> + <createData entity="DefaultPerson" mergeKey="createPerson"/> + <actionGroup ref="FunctionalActionGroupWithData" mergeKey="actionGroupWithPersistedData1"> <argument name="person" value="$createPerson$"/> </actionGroup> </test> <test name="ActionGroupWithTopLevelPersistedData"> - <actionGroup ref="functionalActionGroupWithData" mergeKey="actionGroupWithPersistedData1"> + <actionGroup ref="FunctionalActionGroupWithData" mergeKey="actionGroupWithPersistedData1"> <argument name="person" value="$$createPersonParam$$"/> </actionGroup> </test> <test name="MultipleActionGroupsTest"> <amOnPage mergeKey="step1" url="/someUrl"/> - <actionGroup ref="functionalActionGroupWithData" mergeKey="actionGroup1"/> + <actionGroup ref="FunctionalActionGroupWithData" mergeKey="actionGroup1"/> <click mergeKey="step6" selector="loginButton"/> - <actionGroup ref="functionalActionGroupWithData" mergeKey="actionGroupWithDataOverride2"> - <argument name="person" value="replacementPerson"/> + <actionGroup ref="FunctionalActionGroupWithData" mergeKey="actionGroupWithDataOverride2"> + <argument name="person" value="ReplacementPerson"/> </actionGroup> </test> <test name="MergedActionGroupTest"> - <actionGroup ref="functionalActionGroupForMerge" mergeKey="actionGroupForMerge"> - <argument name="myArg" value="defaultPerson"/> + <actionGroup ref="FunctionalActionGroupForMerge" mergeKey="actionGroupForMerge"> + <argument name="myArg" value="DefaultPerson"/> </actionGroup> </test> </cest> -</config> \ No newline at end of file +</config> diff --git a/dev/tests/verification/TestModule/Cest/mergeBaseFunctionalCest.xml b/dev/tests/verification/TestModule/Cest/mergeBaseFunctionalCest.xml index 05c6a0b87..01801c15b 100644 --- a/dev/tests/verification/TestModule/Cest/mergeBaseFunctionalCest.xml +++ b/dev/tests/verification/TestModule/Cest/mergeBaseFunctionalCest.xml @@ -29,8 +29,8 @@ <click mergeKey="step6" selector=".step6"/> </test> <test name="MergedReferencesTest"> - <fillField mergeKey="fillField1" selector="{{SampleSection.mergeElement}}" userInput="{{defaultPerson.mergedField}}"/> - <fillField mergeKey="fillField2" selector="{{SampleSection.newElement}}" userInput="{{defaultPerson.newField}}" /> + <fillField mergeKey="fillField1" selector="{{SampleSection.mergeElement}}" userInput="{{DefaultPerson.mergedField}}"/> + <fillField mergeKey="fillField2" selector="{{SampleSection.newElement}}" userInput="{{DefaultPerson.newField}}" /> </test> </cest> -</config> \ No newline at end of file +</config> diff --git a/dev/tests/verification/TestModule/Cest/mergeInFunctionalCest.xml b/dev/tests/verification/TestModule/Cest/mergeInFunctionalCest.xml index 1f32b758b..304000252 100644 --- a/dev/tests/verification/TestModule/Cest/mergeInFunctionalCest.xml +++ b/dev/tests/verification/TestModule/Cest/mergeInFunctionalCest.xml @@ -19,12 +19,12 @@ <amOnPage url="/afterUrl1" mergeKey="after1"/> </after> <test name="BasicMergeTest"> - <click mergeKey="step7Merge" selector="{{SampleSection.oneParamElement(defaultPerson.firstname)}} .step7Merge" after="step6Merge"/> + <click mergeKey="step7Merge" selector="{{SampleSection.oneParamElement(DefaultPerson.firstname)}} .step7Merge" after="step6Merge"/> <click mergeKey="step2" selector="#step2" after="step1"/> <click mergeKey="step4" selector="#step4" before="step5"/> <click mergeKey="step6" remove="true"/> <click mergeKey="step6Merge" selector="#step6Merged" after="step5"/> - <actionGroup ref="functionalActionGroupWithData" mergeKey="step8Merge" after="step7Merge"/> + <actionGroup ref="FunctionalActionGroupWithData" mergeKey="step8Merge" after="step7Merge"/> </test> </cest> -</config> \ No newline at end of file +</config> diff --git a/dev/tests/verification/TestModule/Cest/persistedReplacementCest.xml b/dev/tests/verification/TestModule/Cest/persistedReplacementCest.xml index 17a6fba36..48cff411e 100644 --- a/dev/tests/verification/TestModule/Cest/persistedReplacementCest.xml +++ b/dev/tests/verification/TestModule/Cest/persistedReplacementCest.xml @@ -10,11 +10,11 @@ xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> <cest name="PersistedReplacementCest"> <before> - <createData entity="replacementPerson" mergeKey="createData1"/> + <createData entity="ReplacementPerson" mergeKey="createData1"/> </before> <test name="PersistedReplacementTest"> - <createData entity="replacementPerson" mergeKey="testScopeData"/> - <createData entity="uniquePerson" mergeKey="uniqueData"/> + <createData entity="ReplacementPerson" mergeKey="testScopeData"/> + <createData entity="UniquePerson" mergeKey="uniqueData"/> <!-- parameterized url that uses literal params --> <amOnPage url="{{SamplePage.url('success','success2')}}" mergeKey="a0"/> @@ -34,7 +34,7 @@ <click selector="{{SampleSection.twoParamElement($testScopeData.firstname$,'success')}}" mergeKey="c2"/> <!-- parameterized selector with literal, static data, and created data --> - <click selector="{{SampleSection.threeParamElement('John', replacementPerson.lastname, $testScopeData.lastname$)}}" + <click selector="{{SampleSection.threeParamElement('John', ReplacementPerson.lastname, $testScopeData.lastname$)}}" mergeKey="c3"/> <!-- selector that uses created data --> @@ -64,4 +64,4 @@ </test> </cest> -</config> \ No newline at end of file +</config> diff --git a/dev/tests/verification/TestModule/Cest/sampleSuiteCest.xml b/dev/tests/verification/TestModule/Cest/sampleSuiteCest.xml index 9f09a9eee..712fe2636 100644 --- a/dev/tests/verification/TestModule/Cest/sampleSuiteCest.xml +++ b/dev/tests/verification/TestModule/Cest/sampleSuiteCest.xml @@ -8,21 +8,21 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> - <cest name="sampleSuiteCest"> - <test name="includeTest"> + <cest name="SampleSuiteCest"> + <test name="IncludeTest"> <amOnPage mergeKey="testOnPage" url="/someUrl"/> <see mergeKey="seeThePage" selector=".someSelector"/> <click mergeKey="clickOnSomething" selector=".clickable"/> <fillField mergeKey="fillAField" selector=".fillable"/> </test> - <test name="excludeTest"> + <test name="ExcludeTest"> <amOnPage mergeKey="testOnPage" url="/someUrl"/> <see mergeKey="seeThePage" selector=".someSelector"/> <click mergeKey="clickOnSomething" selector=".clickable"/> <fillField mergeKey="fillAField" selector=".fillable"/> </test> </cest> - <cest name="sampleSuite2Cest"> + <cest name="SampleSuite2Cest"> <annotations> <group value="exclude"/> </annotations> @@ -33,8 +33,8 @@ <fillField mergeKey="fillAField" selector=".fillable"/> </test> </cest> - <cest name="sampleSuite3Cest"> - <test name="includeTest"> + <cest name="SampleSuite3Cest"> + <test name="IncludeTest"> <annotations> <group value="include"/> </annotations> @@ -50,7 +50,7 @@ <fillField mergeKey="fillAField" selector=".fillable"/> </test> </cest> - <cest name="sampleSuite4Cest"> + <cest name="SampleSuite4Cest"> <test name="additionalTest"> <annotations> <group value="exclude"/> @@ -60,14 +60,14 @@ <click mergeKey="clickOnSomething" selector=".clickable"/> <fillField mergeKey="fillAField" selector=".fillable"/> </test> - <test name="includeTest"> + <test name="IncludeTest"> <amOnPage mergeKey="testOnPage" url="/someUrl"/> <see mergeKey="seeThePage" selector=".someSelector"/> <click mergeKey="clickOnSomething" selector=".clickable"/> <fillField mergeKey="fillAField" selector=".fillable"/> </test> </cest> - <cest name="sampleSuite5Cest"> + <cest name="SampleSuite5Cest"> <annotations> <group value="include"/> </annotations> @@ -77,11 +77,11 @@ <click mergeKey="clickOnSomething" selector=".clickable"/> <fillField mergeKey="fillAField" selector=".fillable"/> </test> - <test name="excludeTest"> + <test name="ExcludeTest"> <amOnPage mergeKey="testOnPage" url="/someUrl"/> <see mergeKey="seeThePage" selector=".someSelector"/> <click mergeKey="clickOnSomething" selector=".clickable"/> <fillField mergeKey="fillAField" selector=".fillable"/> </test> </cest> -</config> \ No newline at end of file +</config> diff --git a/dev/tests/verification/TestModule/Data/persistedReplacementData.xml b/dev/tests/verification/TestModule/Data/persistedReplacementData.xml index afe4585f1..fba2be632 100644 --- a/dev/tests/verification/TestModule/Data/persistedReplacementData.xml +++ b/dev/tests/verification/TestModule/Data/persistedReplacementData.xml @@ -9,15 +9,15 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd"> - <entity name="replacementPerson" type="samplePerson"> + <entity name="ReplacementPerson" type="samplePerson"> <data key="firstname">John</data> <data key="lastName">Doe</data> </entity> - <entity name="uniquePerson" type="samplePerson"> + <entity name="UniquePerson" type="samplePerson"> <data key="firstname" unique="suffix">John</data> <data key="lastName">Doe</data> </entity> - <entity name="defaultPerson" type="samplePerson"> + <entity name="DefaultPerson" type="samplePerson"> <data key="firstname">Jane</data> <data key="lastName">Dane</data> <data key="mergedField">unmerged</data> diff --git a/dev/tests/verification/TestModule/Data/persistedReplacementMergeData.xml b/dev/tests/verification/TestModule/Data/persistedReplacementMergeData.xml index 7f47ffe17..aa1893b40 100644 --- a/dev/tests/verification/TestModule/Data/persistedReplacementMergeData.xml +++ b/dev/tests/verification/TestModule/Data/persistedReplacementMergeData.xml @@ -9,7 +9,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd"> - <entity name="defaultPerson" type="samplePerson"> + <entity name="DefaultPerson" type="samplePerson"> <data key="mergedField">merged</data> <data key="newField">newField</data> </entity> diff --git a/dev/tests/verification/TestModule/Section/zMergeSection.xml b/dev/tests/verification/TestModule/Section/zMergeSection.xml index d54416993..4e04a19fb 100644 --- a/dev/tests/verification/TestModule/Section/zMergeSection.xml +++ b/dev/tests/verification/TestModule/Section/zMergeSection.xml @@ -16,4 +16,4 @@ <element name="mergeElement" type="select" selector="#merge"/> <element name="newElement" type="select" selector="#newElement"/> </section> -</config> \ No newline at end of file +</config> diff --git a/dev/tests/verification/Tests/ActionGroupMergeGenerationTest.php b/dev/tests/verification/Tests/ActionGroupMergeGenerationTest.php index c13698cf3..eae2dad70 100644 --- a/dev/tests/verification/Tests/ActionGroupMergeGenerationTest.php +++ b/dev/tests/verification/Tests/ActionGroupMergeGenerationTest.php @@ -24,12 +24,20 @@ public function testMergeFunctionalCest() $this->runComparisonTest(self::MERGE_FUNCTIONAL_CEST); } + /** + * Test generation of a cest file with action group references. + */ public function testActionGroupFunctionalCest() { $this->runComparisonTest(self::ACTION_GROUP_FUNCTIONAL_CEST); } + /** + * Generate a Cest by name and assert that it equals the corresponding .txt source of truth + * + * @param string $cestName + */ private function runComparisonTest($cestName) { $cest = CestObjectHandler::getInstance()->getObject($cestName); @@ -49,4 +57,4 @@ private function runComparisonTest($cestName) $cestFile ); } -} \ No newline at end of file +} diff --git a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php index 9f167a768..bbe713c06 100644 --- a/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php +++ b/src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php @@ -81,7 +81,7 @@ public function resolveOperationDataArray($entityObject, $operationMetadata, $op $entityObject->getName() )); } elseif (null === $entityObj) { - continue; + continue; } $operationData = $this->resolveOperationDataArray( $entityObj, diff --git a/src/Magento/FunctionalTestingFramework/Suite/etc/sampleSuite.xml b/src/Magento/FunctionalTestingFramework/Suite/etc/sampleSuite.xml index 7a120b3e2..20adfae57 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/etc/sampleSuite.xml +++ b/src/Magento/FunctionalTestingFramework/Suite/etc/sampleSuite.xml @@ -15,7 +15,7 @@ </include> <exclude> <group name="someGroup"/> - <cest name="excludeTest" test=""/> + <cest name="ExcludeTest" test=""/> <group name="excludeGroup"/> <module name="moduleName" file="excludeFile"/> </exclude> diff --git a/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/MetadataGenUtil.php b/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/MetadataGenUtil.php index 2015a2554..c0de1827e 100644 --- a/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/MetadataGenUtil.php +++ b/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/MetadataGenUtil.php @@ -19,7 +19,7 @@ class MetadataGenUtil * * @var Mustache_Engine */ - private $mustache_engine; + private $mustacheEngine; /** * Name of the operation (e.g. createCategory) @@ -83,13 +83,19 @@ public function __construct($operationName, $operationDataType, $operationUrl, $ */ public function generateMetadataFile() { - $this->initMustacheTemplates(); + // Load Mustache templates + $this->mustacheEngine = new Mustache_Engine( + ['loader' => new Mustache_Loader_FilesystemLoader("views"), + 'partials_loader' => new Mustache_Loader_FilesystemLoader( + "views" . DIRECTORY_SEPARATOR . "partials" + )] + ); // parse the string params into an array parse_str($this->inputString, $results); $data = $this->convertResultToEntry($results, $this->operationDataType); $data = $this->appendParentParams($data); - $output = $this->mustache_engine->render('operation', $data); + $output = $this->mustacheEngine->render('operation', $data); $this->cleanAndCreateOutputDir(); file_put_contents( $this->filepath, @@ -97,21 +103,6 @@ public function generateMetadataFile() ); } - /** - * Function which initializes mustache templates for file generation. - * - * @return void - */ - private function initMustacheTemplates() - { - $this->mustache_engine = new Mustache_Engine( - ['loader' => new Mustache_Loader_FilesystemLoader("views"), - 'partials_loader' => new Mustache_Loader_FilesystemLoader( - "views" . DIRECTORY_SEPARATOR . "partials" - )] - ); - } - /** * Function which takes the top level params from the user and returns an array appended with the needed config. * diff --git a/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/views/operation.mustache b/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/views/operation.mustache index f3ba9ddfe..ad81c99ae 100644 --- a/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/views/operation.mustache +++ b/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/views/operation.mustache @@ -10,4 +10,4 @@ <operation name="{{operationName}}" dataType="{{operationDataType}}" type="create" auth="adminFormKey" url="{{operationUrl}}" method="POST"> {{>object}} </operation> -</config> \ No newline at end of file +</config> diff --git a/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/views/partials/object.mustache b/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/views/partials/object.mustache index 2e7210a8f..7d3aaf5ca 100644 --- a/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/views/partials/object.mustache +++ b/src/Magento/FunctionalTestingFramework/Util/MetadataGenerator/views/partials/object.mustache @@ -7,4 +7,4 @@ {{> object}} {{/hasChildObj}} </object> -{{/objects}} \ No newline at end of file +{{/objects}} From 6ee42651876b7c14a77e427c3f912baaa41c2121 Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@magento.com> Date: Tue, 7 Nov 2017 11:16:04 -0600 Subject: [PATCH 23/23] MQE-523: Create mainline PRs for previous sprint (12) - Use git mv to force rename --- .../{functionalActionGroup.xml => FunctionalActionGroup.xml} | 0 ...geFunctionalActionGroup.xml => MergeFunctionalActionGroup.xml} | 0 ...ctionGroupFunctionalCest.xml => ActionGroupFunctionalCest.xml} | 0 .../{mergeBaseFunctionalCest.xml => MergeBaseFunctionalCest.xml} | 0 .../Cest/{mergeInFunctionalCest.xml => MergeInFunctionalCest.xml} | 0 ...{persistedReplacementCest.xml => PersistedReplacementCest.xml} | 0 .../TestModule/Cest/{sampleSuiteCest.xml => SampleSuiteCest.xml} | 0 ...{persistedReplacementData.xml => PersistedReplacementData.xml} | 0 ...ReplacementMergeData.xml => PersistedReplacementMergeData.xml} | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename dev/tests/verification/TestModule/ActionGroup/{functionalActionGroup.xml => FunctionalActionGroup.xml} (100%) rename dev/tests/verification/TestModule/ActionGroup/{mergeFunctionalActionGroup.xml => MergeFunctionalActionGroup.xml} (100%) rename dev/tests/verification/TestModule/Cest/{actionGroupFunctionalCest.xml => ActionGroupFunctionalCest.xml} (100%) rename dev/tests/verification/TestModule/Cest/{mergeBaseFunctionalCest.xml => MergeBaseFunctionalCest.xml} (100%) rename dev/tests/verification/TestModule/Cest/{mergeInFunctionalCest.xml => MergeInFunctionalCest.xml} (100%) rename dev/tests/verification/TestModule/Cest/{persistedReplacementCest.xml => PersistedReplacementCest.xml} (100%) rename dev/tests/verification/TestModule/Cest/{sampleSuiteCest.xml => SampleSuiteCest.xml} (100%) rename dev/tests/verification/TestModule/Data/{persistedReplacementData.xml => PersistedReplacementData.xml} (100%) rename dev/tests/verification/TestModule/Data/{persistedReplacementMergeData.xml => PersistedReplacementMergeData.xml} (100%) diff --git a/dev/tests/verification/TestModule/ActionGroup/functionalActionGroup.xml b/dev/tests/verification/TestModule/ActionGroup/FunctionalActionGroup.xml similarity index 100% rename from dev/tests/verification/TestModule/ActionGroup/functionalActionGroup.xml rename to dev/tests/verification/TestModule/ActionGroup/FunctionalActionGroup.xml diff --git a/dev/tests/verification/TestModule/ActionGroup/mergeFunctionalActionGroup.xml b/dev/tests/verification/TestModule/ActionGroup/MergeFunctionalActionGroup.xml similarity index 100% rename from dev/tests/verification/TestModule/ActionGroup/mergeFunctionalActionGroup.xml rename to dev/tests/verification/TestModule/ActionGroup/MergeFunctionalActionGroup.xml diff --git a/dev/tests/verification/TestModule/Cest/actionGroupFunctionalCest.xml b/dev/tests/verification/TestModule/Cest/ActionGroupFunctionalCest.xml similarity index 100% rename from dev/tests/verification/TestModule/Cest/actionGroupFunctionalCest.xml rename to dev/tests/verification/TestModule/Cest/ActionGroupFunctionalCest.xml diff --git a/dev/tests/verification/TestModule/Cest/mergeBaseFunctionalCest.xml b/dev/tests/verification/TestModule/Cest/MergeBaseFunctionalCest.xml similarity index 100% rename from dev/tests/verification/TestModule/Cest/mergeBaseFunctionalCest.xml rename to dev/tests/verification/TestModule/Cest/MergeBaseFunctionalCest.xml diff --git a/dev/tests/verification/TestModule/Cest/mergeInFunctionalCest.xml b/dev/tests/verification/TestModule/Cest/MergeInFunctionalCest.xml similarity index 100% rename from dev/tests/verification/TestModule/Cest/mergeInFunctionalCest.xml rename to dev/tests/verification/TestModule/Cest/MergeInFunctionalCest.xml diff --git a/dev/tests/verification/TestModule/Cest/persistedReplacementCest.xml b/dev/tests/verification/TestModule/Cest/PersistedReplacementCest.xml similarity index 100% rename from dev/tests/verification/TestModule/Cest/persistedReplacementCest.xml rename to dev/tests/verification/TestModule/Cest/PersistedReplacementCest.xml diff --git a/dev/tests/verification/TestModule/Cest/sampleSuiteCest.xml b/dev/tests/verification/TestModule/Cest/SampleSuiteCest.xml similarity index 100% rename from dev/tests/verification/TestModule/Cest/sampleSuiteCest.xml rename to dev/tests/verification/TestModule/Cest/SampleSuiteCest.xml diff --git a/dev/tests/verification/TestModule/Data/persistedReplacementData.xml b/dev/tests/verification/TestModule/Data/PersistedReplacementData.xml similarity index 100% rename from dev/tests/verification/TestModule/Data/persistedReplacementData.xml rename to dev/tests/verification/TestModule/Data/PersistedReplacementData.xml diff --git a/dev/tests/verification/TestModule/Data/persistedReplacementMergeData.xml b/dev/tests/verification/TestModule/Data/PersistedReplacementMergeData.xml similarity index 100% rename from dev/tests/verification/TestModule/Data/persistedReplacementMergeData.xml rename to dev/tests/verification/TestModule/Data/PersistedReplacementMergeData.xml