|
5 | 5 | */
|
6 | 6 | namespace tests\unit\Magento\FunctionalTestFramework\Console;
|
7 | 7 |
|
8 |
| -use AspectMock\Test as AspectMock; |
9 | 8 | use PHPUnit\Framework\TestCase;
|
10 | 9 | use Magento\FunctionalTestingFramework\Console\BaseGenerateCommand;
|
11 | 10 | use Magento\FunctionalTestingFramework\Suite\Objects\SuiteObject;
|
|
15 | 14 |
|
16 | 15 | class BaseGenerateCommandTest extends TestCase
|
17 | 16 | {
|
18 |
| - public function tearDown(): void |
19 |
| - { |
20 |
| - AspectMock::clean(); |
21 |
| - } |
22 |
| - |
23 | 17 | public function testOneTestOneSuiteConfig()
|
24 | 18 | {
|
25 | 19 | $testOne = new TestObject('Test1', [], [], []);
|
@@ -182,13 +176,25 @@ public function testSuiteToTestSyntax()
|
182 | 176 | */
|
183 | 177 | public function mockHandlers($testArray, $suiteArray)
|
184 | 178 | {
|
185 |
| - AspectMock::double(TestObjectHandler::class, ['initTestData' => ''])->make(); |
| 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 | + |
186 | 186 | $handler = TestObjectHandler::getInstance();
|
187 | 187 | $property = new \ReflectionProperty(TestObjectHandler::class, 'tests');
|
188 | 188 | $property->setAccessible(true);
|
189 | 189 | $property->setValue($handler, $testArray);
|
190 | 190 |
|
191 |
| - AspectMock::double(SuiteObjectHandler::class, ['initSuiteData' => ''])->make(); |
| 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 | + |
192 | 198 | $handler = SuiteObjectHandler::getInstance();
|
193 | 199 | $property = new \ReflectionProperty(SuiteObjectHandler::class, 'suiteObjects');
|
194 | 200 | $property->setAccessible(true);
|
|
0 commit comments