Completed
Push — master ( 6d6774...64f3ed )
by Jeroen
11:23 queued 05:13
created

Tests/unit/Entity/AbstractEntityTest.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
3
namespace Kunstmaan\AdminBundle\Tests\Entity;
4
5
use Kunstmaan\AdminBundle\Entity\AbstractEntity;
6
use PHPUnit\Framework\TestCase;
7
8
class AbstractEntityTest extends TestCase
9
{
10
    /**
11
     * @var AbstractEntity
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 = $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...
22
    }
23
24
    public function testGetSetId()
25
    {
26
        $this->object->setId(5);
27
        $this->assertEquals(5, $this->object->getId());
28
    }
29
30
    public function test__toString()
31
    {
32
        $this->object->setId(8);
33
        $this->assertEquals('8', $this->object->__toString());
34
    }
35
}
36