Skip to content

Commit 66e2290

Browse files
authored
Merge branch 'develop' into master
2 parents d43d2a4 + 56db66b commit 66e2290

File tree

6 files changed

+36
-7
lines changed

6 files changed

+36
-7
lines changed

etc/config/command.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ function escapeCommand($command)
9696
*/
9797
function validateCommand($magentoBinary, $command)
9898
{
99+
// phpcs:ignore Magento2.Security.InsecureFunction
99100
exec($magentoBinary . ' list', $commandList);
100101
// Trim list of commands after first whitespace
101102
$commandList = array_map("trimAfterWhitespace", $commandList);

src/Magento/FunctionalTestingFramework/Allure/AllureHelper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public static function addAttachmentToCurrentStep($data, $caption): void
2424
{
2525
if (!is_string($data)) {
2626
try {
27+
// phpcs:ignore Magento2.Security.InsecureFunction
2728
$data = serialize($data);
2829
} catch (\Exception $exception) {
2930
throw new \Exception($data->getMessage());
@@ -48,6 +49,7 @@ public static function addAttachmentToCurrentStep($data, $caption): void
4849
public static function addAttachmentToLastStep($data, $caption): void
4950
{
5051
if (!is_string($data)) {
52+
// phpcs:ignore Magento2.Security.InsecureFunction
5153
$data = serialize($data);
5254
}
5355
if (@file_exists($data) && is_file($data)) {

src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/SecretStorage/VaultStorage.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ private function getTokenHelperScript($lines)
251251
*/
252252
private function execVaultTokenHelper($cmd)
253253
{
254+
// phpcs:ignore Magento2.Security.InsecureFunction
254255
exec($cmd, $out, $status);
255256
if ($status === 0 && isset($out[0]) && !empty($out[0])) {
256257
return $out[0];
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\FunctionalTestingFramework\DataTransport\Auth\Tfa;
9+
10+
use DateTimeImmutable;
11+
use Psr\Clock\ClockInterface;
12+
13+
class Clock implements ClockInterface
14+
{
15+
/**
16+
* Return DateTimeImmutable class object
17+
*
18+
* @return DateTimeImmutable
19+
*/
20+
public function now(): DateTimeImmutable
21+
{
22+
return new DateTimeImmutable();
23+
}
24+
}

src/Magento/FunctionalTestingFramework/DataTransport/Auth/Tfa/OTP.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ private static function create($path)
5757
throw new TestFrameworkException('Unable to get OTP' . PHP_EOL . $e->getMessage());
5858
}
5959

60-
self::$totps[$path] = TOTP::create($secret);
60+
self::$totps[$path] = TOTP::create(
61+
$secret,
62+
TOTP::DEFAULT_PERIOD,
63+
TOTP::DEFAULT_DIGEST,
64+
TOTP::DEFAULT_DIGITS,
65+
TOTP::DEFAULT_EPOCH,
66+
new Clock()
67+
);
6168
self::$totps[$path]->setIssuer('MFTF');
6269
self::$totps[$path]->setLabel('MFTF Testing');
6370
}

src/Magento/FunctionalTestingFramework/Extension/TestContextExtension.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,6 @@ public function stepName(\Codeception\Event\StepEvent $e)
383383
//Hard set to 200; we don't expose this config in MFTF
384384
$argumentsLength = 200;
385385
$stepKey = null;
386-
387386
if (!($e->getStep() instanceof Comment)) {
388387
$stepKey = $this->retrieveStepKeyForAllure($e->getStep(), $e->getTest()->getMetadata()->getFilename());
389388
$isActionGroup = (
@@ -401,15 +400,10 @@ public function stepName(\Codeception\Event\StepEvent $e)
401400
}
402401
// DO NOT alter action if actionGroup is starting, need the exact actionGroup name for good logging
403402
if (strpos($stepAction, ActionGroupObject::ACTION_GROUP_CONTEXT_START) === false
404-
&& !($e->getStep() instanceof Comment)
405403
) {
406404
$stepAction = $e->getStep()->getHumanizedActionWithoutArguments();
407405
}
408406
$stepArgs = $e->getStep()->getArgumentsAsString($argumentsLength);
409-
if (!trim($stepAction)) {
410-
$stepAction = $e->getStep()->getMetaStep()->getHumanizedActionWithoutArguments();
411-
$stepArgs = $e->getStep()->getMetaStep()->getArgumentsAsString($argumentsLength);
412-
}
413407
$stepName = '';
414408

415409
if (isset($stepName)) {

0 commit comments

Comments
 (0)