Code Duplication    Length = 27-37 lines in 3 locations

src/Kunstmaan/PagePartBundle/Tests/unit/Entity/RawHTMLPagePartTest.php 1 location

@@ 11-47 (lines=37) @@
8
/**
9
 * Class RawHTMLPagePartTest
10
 */
11
class RawHTMLPagePartTest extends TestCase
12
{
13
    /**
14
     * @var RawHTMLPagePart
15
     */
16
    protected $object;
17
18
    /**
19
     * Sets up the fixture, for example, opens a network connection.
20
     * This method is called before a test is executed.
21
     */
22
    protected function setUp()
23
    {
24
        $this->object = new RawHTMLPagePart();
25
    }
26
27
    public function testToString()
28
    {
29
        $this->assertEquals('RawHTMLPagePart ' . htmlentities($this->object->getContent()), $this->object->__toString());
30
    }
31
32
    public function testGetDefaultView()
33
    {
34
        $this->assertEquals('KunstmaanPagePartBundle:RawHTMLPagePart:view.html.twig', $this->object->getDefaultView());
35
    }
36
37
    public function testSetGetContent()
38
    {
39
        $this->object->setContent('tèst content with s3ç!àL');
40
        $this->assertEquals($this->object->getContent(), 'tèst content with s3ç!àL');
41
    }
42
43
    public function testGetDefaultAdminType()
44
    {
45
        $this->assertEquals('Kunstmaan\PagePartBundle\Form\RawHTMLPagePartAdminType', $this->object->getDefaultAdminType());
46
    }
47
}
48

src/Kunstmaan/PagePartBundle/Tests/unit/Entity/TextPagePartTest.php 1 location

@@ 8-44 (lines=37) @@
5
use Kunstmaan\PagePartBundle\Entity\TextPagePart;
6
use PHPUnit\Framework\TestCase;
7
8
class TextPagePartTest extends TestCase
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('KunstmaanPagePartBundle: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

src/Kunstmaan/SeoBundle/Tests/unit/Entity/RobotsTest.php 1 location

@@ 12-38 (lines=27) @@
9
/**
10
 * Class RobotsTest
11
 */
12
class RobotsTest extends TestCase
13
{
14
    /**
15
     * @var Robots
16
     */
17
    protected $object;
18
19
    /**
20
     * Sets up the fixture, for example, opens a network connection.
21
     * This method is called before a test is executed.
22
     */
23
    protected function setUp()
24
    {
25
        $this->object = new Robots();
26
    }
27
28
    public function testGettersSetters()
29
    {
30
        $this->object->setId(11);
31
        $this->object->setRobotsTxt('*');
32
33
        $this->assertEquals(11, $this->object->getId());
34
        $this->assertEquals('*', $this->object->getRobotsTxt());
35
        $this->assertEquals(RobotsType::class, $this->object->getDefaultAdminType());
36
        $this->assertEquals('Robots', $this->object->__toString());
37
    }
38
}
39