![]() Review and refactor the class such that parts of the logic go into smaller specialized classes without breaking backward compatibility. ![]() Preserve public and protected class interfaces to maintain backward compatibility. Poorly designed classes with too many responsibilities and dependencies should be refactored to prevent them from reaching the limit of coupling between objects, but removing excessive dependencies and/or breaking the class down into smaller classes is a backward incompatible implementation. Refactoring classes that reach limit of coupling between objects The setup version of a module must be higher than previous releases of the same module.įor example, the setup version for a fix for the Magento_Catalog module is higher in the develop branch (2.1.3) than previous branch versions (2.0.2 and 2.1.2 for versions 2.0 and 2.1). If the fix was made for a released branch, a pull request for porting it into the develop branch must be created with a high priority and delivered as soon as possible. In cases where an urgent fix was delivered in a previous minor version, treat the fix for the current unpublished version as a high priority task.įor example, issue fixes that change the setup/upgrade version in the unreleased develop branch are delivered first before being ported into the released branches. The module data/schema version must not increase in a patch version release if the next minor version is already released.įor example, the module data/schema version for all patch releases of 2.0 can change prior to the release of 2.1.Īfter 2.1 releases, the version cannot change for 2.0 patch releases, but it can change for 2.1 patch releases until 2.2.ĭeliver fixes that bump the module setup/data version in the current, unpublished version before delivering it to previous minor versions. 'oldOptionalConstructorParameter' => 'bar', 'oldRequiredConstructorParameter' => 'foo', $this->existingClassObject = $objectManager->getObject( $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this) $newDependencyMock = $this->getMock(\New\Dependency\Interface::class) Create dependency mocks with $this->getMock() or $this->getMockBuilder() Use $this->newDependency wherever the new dependency is neededĬlass ExistingClassTest extends \PHPUnit_Framework_TestCase NewDependency = $newDependency ?: ObjectManager::getInstance()->get(\New\Dependency\Interface::class)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |