-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
magento/magento2-functional-testing-framework
#862Labels
Priority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Progress: doneProject: PHP8Project: Platform Health
Description
Goal
codeception/aspect-mock library is still not compatible with PHP 8.0 at the time of the creation of this ticket.
To speed up Magento compatibility with new PHP versions we'd like to eliminate codeception/aspect-mock dependency from MFTF. This will make MFTF compatible with PHP 8.0 that is required for declaring the Magento core PHP 8 compatible as well.
In order to do this existing unit tests using AspectMock should be refactored to use PHPUnit instead.
Task
Eliminate AspectMock usage for the next classes:
- \tests\unit\Magento\FunctionalTestFramework\DataGenerator\Handlers\DataObjectHandlerTest
- \tests\unit\Magento\FunctionalTestFramework\DataGenerator\Handlers\OperationDefinitionObjectHandlerTest
- \tests\unit\Magento\FunctionalTestFramework\Page\Handlers\PageObjectHandlerTest
- \tests\unit\Magento\FunctionalTestFramework\Page\Handlers\SectionObjectHandlerTest
- \tests\unit\Magento\FunctionalTestFramework\Test\Handlers\ActionGroupObjectHandlerTest
- \tests\unit\Magento\FunctionalTestFramework\Test\Util\ActionGroupAnnotationExtractorTest
- \tests\unit\Magento\FunctionalTestFramework\Test\Util\AnnotationExtractorTest
Do code refactoring for all of these files.
Example
Mocking an object using AspectMock (current):
$mock = AspectMock::double(
MockedClass::class,
[
'mockedMethodName' => 'methodReturnValue',
]
)->make();
Mocking an object using PHPUnit (refactored code):
$mock = $this->createMock(File::class);
$file->expects($this->any())
->method('mockedMethodName')
->willReturn('methodReturnValue');
Example pull request: magento/magento2-functional-testing-framework#833
Metadata
Metadata
Assignees
Labels
Priority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Progress: doneProject: PHP8Project: Platform Health