Skip to content

Commit de0e75b

Browse files
MFTF-33583: Reverted mocking with new created property
1 parent efd6a36 commit de0e75b

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

dev/tests/unit/Magento/FunctionalTestFramework/Util/TestGeneratorTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ public static function setUpBeforeClass(): void
5151
protected function setUp(): void
5252
{
5353
TestLoggingUtil::getInstance()->setMockLoggingUtil();
54-
// Used to mock initTestData method running.
55-
$shouldSkipInitTestDataProperty = new ReflectionProperty(TestObjectHandler::class, 'shouldSkipInitTestData');
56-
$shouldSkipInitTestDataProperty->setAccessible(true);
57-
$shouldSkipInitTestDataProperty->setValue(true);
5854
}
5955

6056
/**
@@ -65,10 +61,6 @@ protected function setUp(): void
6561
protected function tearDown(): void
6662
{
6763
GenerationErrorHandler::getInstance()->reset();
68-
69-
$shouldSkipInitTestDataProperty = new ReflectionProperty(TestObjectHandler::class, 'shouldSkipInitTestData');
70-
$shouldSkipInitTestDataProperty->setAccessible(true);
71-
$shouldSkipInitTestDataProperty->setValue(false);
7264
}
7365

7466
/**

src/Magento/FunctionalTestingFramework/Test/Handlers/TestObjectHandler.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ class TestObjectHandler implements ObjectHandlerInterface
4444
*/
4545
private $tests = [];
4646

47-
/**
48-
* Check if initTestData method should be skipped during object initialization.
49-
*
50-
* @var boolean
51-
*/
52-
private static $shouldSkipInitTestData = false;
53-
5447
/**
5548
* Instance of ObjectExtensionUtil class
5649
*
@@ -69,10 +62,7 @@ public static function getInstance($validateAnnotations = true)
6962
{
7063
if (!self::$testObjectHandler) {
7164
self::$testObjectHandler = new TestObjectHandler();
72-
73-
if (!self::$shouldSkipInitTestData) {
74-
self::$testObjectHandler->initTestData($validateAnnotations);
75-
}
65+
self::$testObjectHandler->initTestData($validateAnnotations);
7666
}
7767

7868
return self::$testObjectHandler;

0 commit comments

Comments
 (0)