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\PagePartBundle\Tests\Entity; |
||
4 | |||
5 | use Kunstmaan\PagePartBundle\Entity\TextPagePart; |
||
6 | use PHPUnit\Framework\TestCase; |
||
7 | |||
8 | View Code Duplication | class TextPagePartTest extends TestCase |
|
0 ignored issues
–
show
|
|||
9 | { |
||
10 | /** |
||
11 | * @var TextPagePart |
||
12 | */ |
||
13 | protected $object; |
||
14 | |||
15 | /** |
||
16 | * Sets up the fixture, for example, opens a network connection. |
||
17 | * This method is called before a test is executed. |
||
18 | */ |
||
19 | protected function setUp() |
||
20 | { |
||
21 | $this->object = new TextPagePart(); |
||
22 | } |
||
23 | |||
24 | public function testSetGetContent() |
||
25 | { |
||
26 | $this->object->setContent('tèst content with s3ç!àL'); |
||
27 | $this->assertEquals($this->object->getContent(), 'tèst content with s3ç!àL'); |
||
28 | } |
||
29 | |||
30 | public function testToString() |
||
31 | { |
||
32 | $this->assertEquals('TextPagePart ' . $this->object->getContent(), $this->object->__toString()); |
||
33 | } |
||
34 | |||
35 | public function testGetDefaultView() |
||
36 | { |
||
37 | $this->assertEquals('@KunstmaanPagePart/TextPagePart/view.html.twig', $this->object->getDefaultView()); |
||
38 | } |
||
39 | |||
40 | public function testGetDefaultAdminType() |
||
41 | { |
||
42 | $this->assertEquals('Kunstmaan\PagePartBundle\Form\TextPagePartAdminType', $this->object->getDefaultAdminType()); |
||
43 | } |
||
44 | } |
||
45 |
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.