Completed
Push — master ( 91fdab...75a7b9 )
by
unknown
13:37
created

Tests/unit/Entity/AbstractEntityTest.php (1 issue)

assigning incompatible types to properties.

Bug Documentation Major

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
3
namespace Kunstmaan\AdminBundle\Tests\Entity;
4
5
use Kunstmaan\AdminBundle\Entity\AbstractEntity;
6
7
/**
8
 * Generated by PHPUnit_SkeletonGenerator on 2012-09-21 at 08:00:57.
9
 */
10
class AbstractEntityTest extends \PHPUnit_Framework_TestCase
11
{
12
    /**
13
     * @var AbstractEntity
14
     */
15
    protected $object;
16
17
    /**
18
     * Sets up the fixture, for example, opens a network connection.
19
     * This method is called before a test is executed.
20
     */
21
    protected function setUp()
22
    {
23
        $this->object = $this->getMockForAbstractClass('Kunstmaan\AdminBundle\Entity\AbstractEntity');
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->getMockForAbstrac...ntity\\AbstractEntity') of type object<PHPUnit_Framework_MockObject_MockObject> is incompatible with the declared type object<Kunstmaan\AdminBu...\Entity\AbstractEntity> of property $object.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
24
    }
25
26
    public function testGetSetId()
27
    {
28
        $this->object->setId(5);
29
        $this->assertEquals(5, $this->object->getId());
30
    }
31
32
    public function test__toString()
33
    {
34
        $this->object->setId(8);
35
        $this->assertEquals("8", $this->object->__toString());
36
    }
37
}
38