Completed
Pull Request — 5.0 (#2067)
by Jeroen
31:56 queued 20:07
created

Tests/Entity/DownloadPagePartTest.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
namespace Kunstmaan\MediaPagePartBundle\Tests\Entity;
3
4
use Kunstmaan\MediaBundle\Entity\Media;
5
6
use Kunstmaan\MediaPagePartBundle\Entity\DownloadPagePart;
7
8
use Kunstmaan\MediaPagePartBundle\Form\DownloadPagePartAdminType;
9
10
/**
11
 * Generated by PHPUnit_SkeletonGenerator on 2012-10-01 at 11:05:56.
12
 */
13 View Code Duplication
class DownloadPagePartTest extends \PHPUnit_Framework_TestCase
0 ignored issues
show
This class seems to be duplicated in your project.

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.

Loading history...
14
{
15
    /**
16
     * @var DownloadPagePart
17
     */
18
    protected $object;
19
20
    /**
21
     * Sets up the fixture, for example, opens a network connection.
22
     * This method is called before a test is executed.
23
     */
24
    protected function setUp()
25
    {
26
        $this->object = new DownloadPagePart;
27
    }
28
29
    /**
30
     * Tears down the fixture, for example, closes a network connection.
31
     * This method is called after a test is executed.
32
     */
33
    protected function tearDown()
34
    {
35
    }
36
37
    /**
38
     * @covers Kunstmaan\MediaPagePartBundle\Entity\DownloadPagePart::getMedia
39
     * @covers Kunstmaan\MediaPagePartBundle\Entity\DownloadPagePart::setMedia
40
     */
41
    public function testGetSetMedia()
42
    {
43
        $media = new Media();
44
        $media->setId(5);
45
        $this->object->setMedia($media);
46
        $this->assertEquals(5, $this->object->getMedia()->getId());
47
    }
48
49
    /**
50
     * @covers Kunstmaan\MediaPagePartBundle\Entity\DownloadPagePart::getDefaultView
51
     */
52
    public function testGetDefaultView()
53
    {
54
        $defaultView = $this->object->getDefaultView();
55
        $this->assertEquals("KunstmaanMediaPagePartBundle:DownloadPagePart:view.html.twig", $defaultView);
56
    }
57
58
    /**
59
     * @covers Kunstmaan\MediaPagePartBundle\Entity\DownloadPagePart::getDefaultAdminType
60
     */
61
    public function testGetDefaultAdminType()
62
    {
63
        $this->assertEquals(DownloadPagePartAdminType::class, $this->object->getDefaultAdminType());
64
    }
65
}
66