These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Kunstmaan\AdminBundle\Tests\Form; |
||
4 | |||
5 | use Kunstmaan\AdminBundle\Form\DashboardConfigurationType; |
||
6 | use PHPUnit\Framework\TestCase; |
||
7 | use Symfony\Component\Form\FormBuilder; |
||
8 | |||
9 | /** |
||
10 | * Class DashboardConfigurationTypeTest |
||
11 | */ |
||
12 | View Code Duplication | class DashboardConfigurationTypeTest extends TestCase |
|
0 ignored issues
–
show
|
|||
13 | { |
||
14 | public function testMethods() |
||
15 | { |
||
16 | $type = new DashboardConfigurationType(); |
||
17 | |||
18 | $builder = $this->createMock(FormBuilder::class); |
||
19 | |||
20 | $builder->expects($this->exactly(2)) |
||
21 | ->method('add') |
||
22 | ->willReturn(true); |
||
23 | |||
24 | /* @var FormBuilder $builder */ |
||
25 | $type->buildForm($builder, []); |
||
26 | |||
27 | $this->assertEquals('dashboardconfiguration', $type->getBlockPrefix()); |
||
28 | } |
||
29 | } |
||
30 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.