Skip to content

Commit a449f07

Browse files
author
silinmykola
committed
33292 change tearDown method
1 parent 3396029 commit a449f07

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

dev/tests/unit/Magento/FunctionalTestFramework/Console/BaseGenerateCommandTest.php

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@
1414

1515
class BaseGenerateCommandTest extends TestCase
1616
{
17+
public function tearDown(): void
18+
{
19+
$handler = TestObjectHandler::getInstance();
20+
$property = new \ReflectionProperty(TestObjectHandler::class, 'tests');
21+
$property->setAccessible(true);
22+
$property->setValue($handler, []);
23+
24+
$handler = SuiteObjectHandler::getInstance();
25+
$property = new \ReflectionProperty(SuiteObjectHandler::class, 'suiteObjects');
26+
$property->setAccessible(true);
27+
$property->setValue($handler, []);
28+
}
1729
public function testOneTestOneSuiteConfig()
1830
{
1931
$testOne = new TestObject('Test1', [], [], []);
@@ -176,25 +188,11 @@ public function testSuiteToTestSyntax()
176188
*/
177189
public function mockHandlers($testArray, $suiteArray)
178190
{
179-
$testObjectHandler = TestObjectHandler::getInstance();
180-
$reflection = new \ReflectionClass(TestObjectHandler::class);
181-
$reflectionMethod = $reflection->getMethod('initTestData');
182-
$reflectionMethod->setAccessible(true);
183-
$output = $reflectionMethod->invoke($testObjectHandler);
184-
$this->assertEquals('', $output);
185-
186191
$handler = TestObjectHandler::getInstance();
187192
$property = new \ReflectionProperty(TestObjectHandler::class, 'tests');
188193
$property->setAccessible(true);
189194
$property->setValue($handler, $testArray);
190195

191-
$suiteObjectHandler = SuiteObjectHandler::getInstance();
192-
$reflection = new \ReflectionClass(SuiteObjectHandler::class);
193-
$reflectionMethod = $reflection->getMethod('initSuiteData');
194-
$reflectionMethod->setAccessible(true);
195-
$output = $reflectionMethod->invoke($suiteObjectHandler);
196-
$this->assertEquals('', $output);
197-
198196
$handler = SuiteObjectHandler::getInstance();
199197
$property = new \ReflectionProperty(SuiteObjectHandler::class, 'suiteObjects');
200198
$property->setAccessible(true);

0 commit comments

Comments
 (0)