Completed
Push — master ( ae5e03...0447ee )
by Jeroen
10:35 queued 04:37
created

unit/Entity/PageParts/AbstractFormPagePartTest.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\FormBundle\Tests\Entity\PageParts;
4
5
use Kunstmaan\FormBundle\Entity\PageParts\AbstractFormPagePart;
6
use PHPUnit\Framework\TestCase;
7
8
class AbstractFormPagePartTest extends TestCase
9
{
10
    /**
11
     * @var AbstractFormPagePart
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\FormBundle\Entity\PageParts\AbstractFormPagePart");
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->getMockForAbstrac...\AbstractFormPagePart') of type object<PHPUnit\Framework\MockObject\MockObject> is incompatible with the declared type object<Kunstmaan\FormBun...s\AbstractFormPagePart> 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 testGetUniqueId()
25
    {
26
        $object = $this->object;
27
        $this->assertSame(str_replace('\\', '', get_class($object)), $object->getUniqueId());
28
    }
29
30
    public function testSetGetLabel()
31
    {
32
        $object = $this->object;
33
        $value = 'Some label';
34
        $object->setLabel($value);
35
        $this->assertEquals($value, $object->getLabel());
36
    }
37
38
    public function testGetAdminView()
39
    {
40
        $stringValue = $this->object->getAdminView();
41
        $this->assertNotNull($stringValue);
42
        $this->assertInternalType('string', $stringValue);
43
    }
44
}
45