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 |
||
10 | class NoCacheWebPathResolverTest extends WebTestCase |
||
11 | { |
||
12 | public function testCouldBeGetFromContainer() |
||
13 | { |
||
14 | $this->createClient(); |
||
15 | |||
16 | $resolver = self::$kernel->getContainer()->get('liip_imagine.cache.resolver.no_cache_web_path'); |
||
17 | |||
18 | $this->assertInstanceOf('Liip\ImagineBundle\Imagine\Cache\Resolver\NoCacheWebPathResolver', $resolver); |
||
19 | } |
||
20 | } |
||
21 |