Completed
Push — master ( 6d6774...64f3ed )
by Jeroen
11:23 queued 05:13
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
/**
12
 * Class AbstractArticleOverviewPageAdminTypeTest
13
 */
14 View Code Duplication
class AbstractArticleOverviewPageAdminTypeTest extends TestCase
15
{
16
    /**
17
     * @var AbstractArticlePageAdminType
18
     */
19
    private $object;
20
21
    public function setUp()
22
    {
23
        $entity = new AbstractArticleOverviewPageAdminType();
24
        $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...
25
    }
26
27
    public function testBlockPrefix()
28
    {
29
        $this->assertEquals('AbstractArticleOverviewPage', $this->object->getBlockPrefix());
30
    }
31
32
    public function testConfigureOptions()
33
    {
34
        $resolver = new OptionsResolver();
35
        $this->object->configureOptions($resolver);
36
        $this->assertTrue($resolver->hasDefault('data_class'));
37
    }
38
39
    public function testBuildForm()
40
    {
41
        $builder = $this->createMock(FormBuilder::class);
42
        $builder->expects($this->exactly(3))->method('add')->willReturn($builder);
43
44
        /* @var FormBuilder $builder */
45
        $this->object->buildForm($builder, []);
46
    }
47
}
48