Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
| 1 | <?php |
||
| 16 | class ResolverFactoryTest extends TestCase |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * @var \PHPUnit_Framework_MockObject_MockObject|\eZ\Publish\Core\MVC\ConfigResolverInterface |
||
| 20 | */ |
||
| 21 | private $configResolver; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var \PHPUnit_Framework_MockObject_MockObject|\Liip\ImagineBundle\Imagine\Cache\Resolver\ResolverInterface |
||
| 25 | */ |
||
| 26 | private $resolver; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var \eZ\Bundle\EzPublishCoreBundle\Imagine\Cache\ResolverFactory |
||
| 30 | */ |
||
| 31 | private $factory; |
||
| 32 | |||
| 33 | protected function setUp() |
||
| 45 | |||
| 46 | View Code Duplication | public function testCreateProxyCacheResolver() |
|
| 66 | |||
| 67 | View Code Duplication | public function testCreateRelativeCacheResolver() |
|
| 87 | } |
||
| 88 |