Completed
Pull Request — 5.6 (#2830)
by Jeroen
14:14
created

Form/AbstractArticleOverviewPageAdminTypeTest.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\ArticleBundle\Tests\Form;
4
5
use Kunstmaan\ArticleBundle\Form\AbstractArticleOverviewPageAdminType;
6
use Kunstmaan\ArticleBundle\Form\AbstractArticlePageAdminType;
7
use PHPUnit\Framework\TestCase;
8
use Symfony\Component\Form\FormBuilder;
9
use Symfony\Component\OptionsResolver\OptionsResolver;
10
11
class AbstractArticleOverviewPageAdminTypeTest extends TestCase
12
{
13
    /**
14
     * @var AbstractArticlePageAdminType
15
     */
16
    private $object;
17
18
    public function setUp()
19
    {
20
        $entity = new AbstractArticleOverviewPageAdminType();
21
        $this->object = $entity;
0 ignored issues
show
Documentation Bug introduced by
It seems like $entity of type object<Kunstmaan\Article...eOverviewPageAdminType> is incompatible with the declared type object<Kunstmaan\Article...ctArticlePageAdminType> 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 testBlockPrefix()
25
    {
26
        $this->assertEquals('AbstractArticleOverviewPage', $this->object->getBlockPrefix());
27
    }
28
29
    public function testConfigureOptions()
30
    {
31
        $resolver = new OptionsResolver();
32
        $this->object->configureOptions($resolver);
33
        $this->assertTrue($resolver->hasDefault('data_class'));
34
    }
35
36
    public function testBuildForm()
37
    {
38
        $builder = $this->createMock(FormBuilder::class);
39
        $builder->expects($this->exactly(3))->method('add')->willReturn($builder);
40
41
        /* @var FormBuilder $builder */
42
        $this->object->buildForm($builder, []);
43
    }
44
}
45