Completed
Pull Request — 5.1 (#2334)
by Jeroen
11:41 queued 55s
created

AbstractAuthorTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testInstantiatingClassDeprecation() 0 4 1
A testGettersAndSetters() 0 12 1
1
<?php
2
3
namespace Kunstmaan\ArticleBundle\Tests\Entity;
4
5
use Kunstmaan\ArticleBundle\Entity\AbstractAuthor;
6
use PHPUnit_Framework_TestCase;
7
8
/**
9
 * Generated by PHPUnit_SkeletonGenerator on 2012-09-04 at 16:54:04.
10
 */
11
class AbstractAuthorTest extends PHPUnit_Framework_TestCase
12
{
13
    /**
14
     * @group legacy
15
     * @expectedDeprecation Instantiating the "Kunstmaan\ArticleBundle\Entity\AbstractAuthor" class is deprecated in KunstmaanArticleBundle 5.1 and will be made abstract in KunstmaanArticleBundle 6.0. Extend your implementation from this class instead.
16
     */
17
    public function testInstantiatingClassDeprecation()
18
    {
19
        new AbstractAuthor();
20
    }
21
22
    public function testGettersAndSetters()
23
    {
24
        $entity = new AbstractAuthor();
25
        $entity->setId(666);
26
        $entity->setLink('https://nasa.gov');
27
        $entity->setName('NASA');
28
29
        $this->assertEquals(666, $entity->getId());
30
        $this->assertEquals('https://nasa.gov', $entity->getLink());
31
        $this->assertEquals('NASA', $entity->getName());
32
        $this->assertEquals('NASA', $entity->__toString());
33
    }
34
}
35