Completed
Pull Request — 5.2 (#2400)
by
unknown
12:28
created

Action::isStructurePage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Kunstmaan\NodeBundle\Tests\Entity;
4
5
use Codeception\Stub;
6
use Kunstmaan\NodeBundle\Entity\AbstractControllerAction;
7
use Kunstmaan\NodeBundle\Entity\HasNodeInterface;
8
use Kunstmaan\NodeBundle\Form\ControllerActionAdminType;
9
use PHPUnit\Framework\TestCase;
10
11
class Action extends AbstractControllerAction
12
{
13
    public function getPossibleChildTypes()
14
    {
15
        return [];
16
    }
17
18
    public function isStructurePage()
19
    {
20
        return false;
21
    }
22
}
23
24
class AbstractControllerActionTest extends TestCase
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
25
{
26
    public function testGetSet()
27
    {
28
        $action = new Action();
29
        $action->setId(5);
30
        $action->setTitle('Global Economic Meltdown - The Movie');
31
        /** @var HasNodeInterface $entity */
32
        $entity = Stub::makeEmpty(HasNodeInterface::class);
33
        $action->setParent($entity);
34
35
        $this->assertEquals(5, $action->getId());
36
        $this->assertEquals('Global Economic Meltdown - The Movie', $action->getTitle());
37
        $this->assertInstanceOf(get_class($entity), $action->getParent());
38
        $this->assertEquals(ControllerActionAdminType::class, $action->getDefaultAdminType());
39
    }
40
}
41