Skip to content

Fixed PHP 8.2 deprecation warnings: 'creation of dynamic property'. #905

New issue

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

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

Already on GitHub? Sign in to your account

Merged
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 @@ -42,11 +42,11 @@ public function testUnusedActiongroupFiles()

public function testUnusedActiongroupFilesReturnedWhenActionXmlFilesAreNotEmpty()
{
$this->scriptUtil = new ScriptUtil();
$scriptUtil = new ScriptUtil();
$unusedEntityCheck = new UnusedEntityCheck();
$domDocument = new \DOMDocument();
$modulePaths = $this->scriptUtil->getAllModulePaths();
$actionGroupXmlFiles = $this->scriptUtil->getModuleXmlFilesByScope($modulePaths, "ActionGroup");
$modulePaths = $scriptUtil->getAllModulePaths();
$actionGroupXmlFiles = $scriptUtil->getModuleXmlFilesByScope($modulePaths, "ActionGroup");
$actionGroupFiles = ['DeprecationCheckActionGroup' =>
'/verification/DeprecationCheckModule/ActionGroup/DeprecationCheckActionGroup.xml',
'ActionGroupWithMultiplePausesActionGroup'=>
Expand Down Expand Up @@ -82,9 +82,9 @@ public function testUnusedSectionFiles()
public function testUnusedSectionFilesReturnedWhenSectionXmlFilesAreNotEmpty()
{
$unusedEntityCheck = new UnusedEntityCheck();
$this->scriptUtil = new ScriptUtil();
$modulePaths = $this->scriptUtil->getAllModulePaths();
$sectionXmlFiles = $this->scriptUtil->getModuleXmlFilesByScope($modulePaths, "Section");
$scriptUtil = new ScriptUtil();
$modulePaths = $scriptUtil->getAllModulePaths();
$sectionXmlFiles = $scriptUtil->getModuleXmlFilesByScope($modulePaths, "Section");

$domDocument = new \DOMDocument();
$section = [
Expand Down Expand Up @@ -119,9 +119,9 @@ public function testUnusedPageFilesReturnedWhenPageXmlFilesPassedAreNotEmpty()
{
$unusedEntityCheck = new UnusedEntityCheck();
$domDocument = new \DOMDocument();
$this->scriptUtil = new ScriptUtil();
$modulePaths = $this->scriptUtil->getAllModulePaths();
$pageXmlFiles = $this->scriptUtil->getModuleXmlFilesByScope($modulePaths, "Page");
$scriptUtil = new ScriptUtil();
$modulePaths = $scriptUtil->getAllModulePaths();
$pageXmlFiles = $scriptUtil->getModuleXmlFilesByScope($modulePaths, "Page");
$page = [
'DeprecationCheckPage' => '/verification/DeprecationCheckModule/Page/DeprecationCheckPage.xml',
'DeprecatedPage' => '/verification/TestModule/Page/DeprecatedPage.xml',
Expand Down Expand Up @@ -164,9 +164,9 @@ public function testUnusedDataReturnedWhenCreateDataEntityAreNotEmpty()
{
$unusedEntityCheck = new UnusedEntityCheck();
$domDocument = new \DOMDocument();
$this->scriptUtil = new ScriptUtil();
$modulePaths = $this->scriptUtil->getAllModulePaths();
$dataXmlFiles = $this->scriptUtil->getModuleXmlFilesByScope($modulePaths, "Data");
$scriptUtil = new ScriptUtil();
$modulePaths = $scriptUtil->getAllModulePaths();
$dataXmlFiles = $scriptUtil->getModuleXmlFilesByScope($modulePaths, "Data");
$data = [
"simpleData" =>
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
class MagentoAllureAdapter extends AllureCodeception
{
const STEP_PASSED = "passed";

/**
* @var array
*/
private $options = [];

/**
* Test files cache.
*
Expand Down Expand Up @@ -184,7 +190,6 @@ public function stepBefore(StepEvent $stepEvent)
// Strip control characters so that report generation does not fail
$stepName = preg_replace('/[[:cntrl:]]/', '', $stepName);

$this->emptyStep = false;
$this->getLifecycle()->fire(new StepStartedEvent($stepName));
}

Expand Down
6 changes: 3 additions & 3 deletions src/Magento/FunctionalTestingFramework/Config/Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ public function __construct(
$this->fileName = $fileName;
$this->idAttributes = array_replace($this->idAttributes, $idAttributes);
$this->schemaFile = $schemaLocator->getSchema();
$this->isValidated = $validationState->isValidated();
$this->perFileSchema = $schemaLocator->getPerFileSchema() &&
$this->isValidated ? $schemaLocator->getPerFileSchema() : null;
$isValidated = $validationState->isValidated();
$this->perFileSchema = $schemaLocator->getPerFileSchema() && $isValidated ?
$schemaLocator->getPerFileSchema() : null;
$this->domDocumentClass = $domDocumentClass;
$this->defaultScope = $defaultScope;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ public function __construct(
*/
protected function _createConfigMerger($mergerClass, $initialContents)
{
return new $mergerClass($initialContents, $this->_idAttributes, self::TYPE_ATTRIBUTE, $this->_perFileSchema);
return new $mergerClass($initialContents, $this->idAttributes, self::TYPE_ATTRIBUTE, $this->perFileSchema);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ class CreatedDataFromOutsideActionGroupCheck implements StaticCheckInterface
*/
private $scriptUtil;

/**
* @var array
*/
private $actionGroupXmlFile = [];

/**
* Checks test dependencies, determined by references in tests versus the dependencies listed in the Magento module
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ class UnusedEntityCheck implements StaticCheckInterface
*/
private $scriptUtil;

/**
* @var array
*/
private $errors = [];

/**
* @var string
*/
private $output = '';

/**
* Checks test dependencies, determined by references in tests versus the dependencies listed in the Magento module
*
Expand Down Expand Up @@ -625,7 +635,7 @@ public function getErrors()
/**
* Return output
*
* @return array
* @return string
*/
public function getOutput()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ public function getAnnotationByName($name)
*/
public function getCustomData()
{
return $this->customData;
return null;
}

/**
Expand Down