Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

use Magento\FunctionalTestingFramework\DataGenerator\Objects\EntityDataObject;
use Magento\FunctionalTestingFramework\DataGenerator\Parsers\DataProfileSchemaParser;
use Magento\FunctionalTestingFramework\Exceptions\XmlException;
use Magento\FunctionalTestingFramework\ObjectManager\ObjectHandlerInterface;
use Magento\FunctionalTestingFramework\ObjectManagerFactory;

Expand Down Expand Up @@ -104,6 +105,7 @@ public function getAllObjects()
*
* @param string[] $parserOutput primitive array output from the Magento parser
* @return EntityDataObject[]
* @throws XmlException
*/
private function processParserOutput($parserOutput)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Magento\FunctionalTestingFramework\DataGenerator\Objects\OperationElement;
use Magento\FunctionalTestingFramework\DataGenerator\Parsers\OperationDefinitionParser;
use Magento\FunctionalTestingFramework\DataGenerator\Util\OperationElementExtractor;
use Magento\FunctionalTestingFramework\Exceptions\XmlException;
use Magento\FunctionalTestingFramework\ObjectManager\ObjectHandlerInterface;
use Magento\FunctionalTestingFramework\ObjectManagerFactory;

Expand Down Expand Up @@ -125,6 +126,8 @@ public function getOperationDefinition($operation, $dataType)
* into an array of objects.
*
* @return void
* @throws \Exception
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
* @SuppressWarnings(PHPMD.UnusedPrivateMethod)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ public function getDataByName($name, $uniquenessFormat)
* @param string $uniqueData
* @param string $uniqueDataFormat
* @return null|string
* @throws TestFrameworkException
*/
private function formatUniqueData($name, $uniqueData, $uniqueDataFormat)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class AdminExecutor extends AbstractExecutor implements CurlInterface
* @param bool $removeBackend
*
* @constructor
* @throws TestFrameworkException
*/
public function __construct($removeBackend)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ class FrontendExecutor extends AbstractExecutor implements CurlInterface
*
* @param string $customerEmail
* @param string $customerPassWord
*
* @throws TestFrameworkException
*/
public function __construct($customerEmail, $customerPassWord)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

namespace Magento\FunctionalTestingFramework\DataGenerator\Persist\Curl;

use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException;
use Magento\FunctionalTestingFramework\Util\Protocol\CurlInterface;
use Magento\FunctionalTestingFramework\Util\Protocol\CurlTransport;

Expand Down Expand Up @@ -54,6 +55,7 @@ class WebapiExecutor extends AbstractExecutor implements CurlInterface
* WebapiExecutor Constructor.
*
* @param string $storeCode
* @throws TestFrameworkException
*/
public function __construct($storeCode = null)
{
Expand All @@ -70,6 +72,7 @@ public function __construct($storeCode = null)
* Returns the authorization token needed for some requests via REST call.
*
* @return void
* @throws TestFrameworkException
*/
protected function authorize()
{
Expand All @@ -94,6 +97,7 @@ protected function authorize()
* @param string $method
* @param array $headers
* @return void
* @throws TestFrameworkException
*/
public function write($url, $data = [], $method = CurlInterface::POST, $headers = [])
{
Expand All @@ -111,6 +115,7 @@ public function write($url, $data = [], $method = CurlInterface::POST, $headers
* @param string $successRegex
* @param string $returnRegex
* @return string
* @throws TestFrameworkException
*/
public function read($successRegex = null, $returnRegex = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public function __construct($operation, $entityObject, $storeCode = null)
* @param array $dependentEntities
* @return array | null
* @throws TestFrameworkException
* @throws \Exception
*/
public function executeRequest($dependentEntities)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

use Magento\FunctionalTestingFramework\DataGenerator\Objects\EntityDataObject;
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\DataObjectHandler;
use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException;

/**
* Class DataPersistenceHandler
Expand Down Expand Up @@ -75,6 +76,7 @@ public function __construct($entityObject, $dependentObjects = [], $customFields
*
* @param string $storeCode
* @return void
* @throws TestFrameworkException
*/
public function createEntity($storeCode = null)
{
Expand All @@ -97,6 +99,8 @@ public function createEntity($storeCode = null)
* @param string $updateDataName
* @param array $updateDependentObjects
* @return void
* @throws TestFrameworkException
* @throws \Exception
*/

public function updateEntity($updateDataName, $updateDependentObjects = [])
Expand All @@ -121,6 +125,7 @@ public function updateEntity($updateDataName, $updateDependentObjects = [])
* @param integer|null $index
* @param string $storeCode
* @return void
* @throws TestFrameworkException
*/

public function getEntity($index = null, $storeCode = null)
Expand All @@ -142,6 +147,7 @@ public function getEntity($index = null, $storeCode = null)
* Function which executes a delete request based on specific operation metadata
*
* @return void
* @throws TestFrameworkException
*/
public function deleteEntity()
{
Expand All @@ -163,6 +169,7 @@ public function getCreatedObject()
* Returns a specific data value based on the CreatedObject's definition.
* @param string $dataName
* @return string
* @throws TestFrameworkException
*/
public function getCreatedDataByName($dataName)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Magento\FunctionalTestingFramework\DataGenerator\Objects\EntityDataObject;
use Magento\FunctionalTestingFramework\DataGenerator\Objects\OperationElement;
use Magento\FunctionalTestingFramework\DataGenerator\Util\OperationElementExtractor;
use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException;

class OperationDataArrayResolver
{
Expand Down Expand Up @@ -174,6 +175,7 @@ public function resolveOperationDataArray($entityObject, $operationMetadata, $op
* @param string $operationKey
* @param string $operationElementType
* @return array|string
* @throws TestFrameworkException
*/
private function resolvePrimitiveReference($entityObject, $operationKey, $operationElementType)
{
Expand Down Expand Up @@ -234,6 +236,7 @@ private function getDependentEntitiesOfType($type)
* @param EntityDataObject $entityObject
* @param string $operationElementValue
* @return EntityDataObject|null
* @throws \Exception
*/
private function resolveOperationObjectAndEntityData($entityObject, $operationElementValue)
{
Expand All @@ -258,6 +261,7 @@ private function resolveOperationObjectAndEntityData($entityObject, $operationEl
* @param string $operation
* @param bool $fromArray
* @return array
* @throws \Exception
*/
private function resolveNonPrimitiveElement($entityName, $operationElement, $operation, $fromArray = false)
{
Expand Down Expand Up @@ -290,6 +294,7 @@ private function resolveNonPrimitiveElement($entityName, $operationElement, $ope
*
* @param string $entityName
* @return EntityDataObject
* @throws \Exception
*/
private function resolveLinkedEntityObject($entityName)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class PageObjectHandler implements ObjectHandlerInterface

/**
* Private constructor
*
* @throws XmlException
*/
private function __construct()
{
Expand Down Expand Up @@ -74,6 +76,7 @@ private function __construct()
* Singleton method to return PageObjectHandler.
*
* @return PageObjectHandler
* @throws XmlException
*/
public static function getInstance()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class SectionObjectHandler implements ObjectHandlerInterface
* Constructor
*
* @constructor
* @throws XmlException
*/
private function __construct()
{
Expand Down Expand Up @@ -93,6 +94,7 @@ private function __construct()
* Initialize and/or return the singleton instance of this class
*
* @return SectionObjectHandler
* @throws XmlException
*/
public static function getInstance()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace Magento\FunctionalTestingFramework\Page\Objects;


use Magento\FunctionalTestingFramework\Exceptions\XmlException;
use Magento\FunctionalTestingFramework\Page\Handlers\SectionObjectHandler;

/**
Expand Down Expand Up @@ -143,6 +144,7 @@ public function hasSection($sectionName)
*
* @param string $sectionName
* @return SectionObject | null
* @throws XmlException
*/
public function getSection($sectionName)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

namespace Magento\FunctionalTestingFramework\Suite\Generators;

use Magento\FunctionalTestingFramework\Exceptions\TestReferenceException;
use Magento\FunctionalTestingFramework\Suite\Objects\SuiteObject;
use Magento\FunctionalTestingFramework\Test\Objects\ActionObject;
use Magento\FunctionalTestingFramework\Test\Objects\TestHookObject;
Expand Down Expand Up @@ -68,6 +69,7 @@ public function __construct()
*
* @param SuiteObject $suiteObject
* @return string
* @throws TestReferenceException
*/
public function generateGroupClass($suiteObject)
{
Expand All @@ -84,6 +86,7 @@ public function generateGroupClass($suiteObject)
*
* @param SuiteObject $suiteObject
* @return string;
* @throws TestReferenceException
*/
private function createClassContent($suiteObject)
{
Expand Down Expand Up @@ -122,6 +125,7 @@ private function extractClassVar($beforeArray, $afterArray)
*
* @param TestHookObject $hookObj
* @return array
* @throws TestReferenceException
*/
private function buildHookMustacheArray($hookObj)
{
Expand Down Expand Up @@ -171,6 +175,7 @@ private function buildHookMustacheArray($hookObj)
* @param ActionObject $action
* @param array $actionEntries
* @return array
* @throws TestReferenceException
*/
private function buildWebDriverActionsMustacheArray($action, $actionEntries)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
namespace Magento\FunctionalTestingFramework\Suite\Handlers;

use Magento\FunctionalTestingFramework\Exceptions\XmlException;
use Magento\FunctionalTestingFramework\ObjectManager\ObjectHandlerInterface;
use Magento\FunctionalTestingFramework\ObjectManagerFactory;
use Magento\FunctionalTestingFramework\Suite\Objects\SuiteObject;
Expand Down Expand Up @@ -43,6 +44,7 @@ private function __construct()
* Function to enforce singleton design pattern
*
* @return ObjectHandlerInterface
* @throws XmlException
*/
public static function getInstance()
{
Expand Down Expand Up @@ -103,6 +105,7 @@ public function getAllTestReferences()
*
* @return void
* @SuppressWarnings(PHPMD.UnusedPrivateMethod)
* @throws XmlException
*/
private function initSuiteData()
{
Expand Down
10 changes: 10 additions & 0 deletions src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace Magento\FunctionalTestingFramework\Suite;

use Magento\FunctionalTestingFramework\Exceptions\TestReferenceException;
use Magento\FunctionalTestingFramework\Exceptions\XmlException;
use Magento\FunctionalTestingFramework\Suite\Generators\GroupClassGenerator;
use Magento\FunctionalTestingFramework\Suite\Handlers\SuiteObjectHandler;
use Magento\FunctionalTestingFramework\Suite\Objects\SuiteObject;
Expand Down Expand Up @@ -71,6 +72,7 @@ public static function getInstance()
*
* @param BaseTestManifest $testManifest
* @return void
* @throws \Exception
*/
public function generateAllSuites($testManifest)
{
Expand All @@ -97,6 +99,7 @@ public function generateAllSuites($testManifest)
*
* @param string $suiteName
* @return void
* @throws \Exception
*/
public function generateSuite($suiteName)
{
Expand All @@ -113,6 +116,8 @@ public function generateSuite($suiteName)
* @param array $tests
* @param string $originalSuiteName
* @return void
* @throws TestReferenceException
* @throws XmlException
*/
private function generateSuiteFromTest($suiteName, $tests = [], $originalSuiteName = null)
{
Expand Down Expand Up @@ -147,6 +152,7 @@ private function generateSuiteFromTest($suiteName, $tests = [], $originalSuiteNa
* @param string $originalSuiteName
* @return void
* @throws TestReferenceException
* @throws XmlException
*/
private function validateTestsReferencedInSuite($suiteName, $testsReferenced, $originalSuiteName)
{
Expand All @@ -173,6 +179,7 @@ private function validateTestsReferencedInSuite($suiteName, $testsReferenced, $o
* @param string $suiteName
* @param array $suiteContent
* @return void
* @throws \Exception
*/
private function generateSplitSuiteFromTest($suiteName, $suiteContent)
{
Expand All @@ -189,6 +196,8 @@ private function generateSplitSuiteFromTest($suiteName, $suiteContent)
* @param array $tests
* @param string $originalSuiteName
* @return null|string
* @throws XmlException
* @throws TestReferenceException
*/
private function generateGroupFile($suiteName, $tests, $originalSuiteName)
{
Expand Down Expand Up @@ -289,6 +298,7 @@ private static function clearPreviousSessionConfigEntries()
* @param string $path
* @param array $tests
* @return void
* @throws TestReferenceException
*/
private function generateRelevantGroupTests($path, $tests)
{
Expand Down
Loading