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\AdminList; |
||
4 | |||
5 | use Doctrine\ORM\EntityManager; |
||
6 | use Kunstmaan\AdminBundle\Helper\Security\Acl\AclHelper; |
||
7 | use Kunstmaan\ArticleBundle\AdminList\AbstractArticleAuthorAdminListConfigurator; |
||
8 | use PHPUnit_Framework_TestCase; |
||
9 | |||
10 | /** |
||
11 | * Class AbstractArticleAuthorAdminListConfiguratorTest |
||
12 | */ |
||
13 | class AbstractArticleAuthorAdminListConfiguratorTest extends PHPUnit_Framework_TestCase |
||
14 | { |
||
15 | /** |
||
16 | * @var AbstractArticleAuthorAdminListConfigurator |
||
17 | */ |
||
18 | protected $object; |
||
19 | |||
20 | /** |
||
21 | * Sets up the fixture, for example, opens a network connection. |
||
22 | * This method is called before a test is executed. |
||
23 | */ |
||
24 | protected function setUp() |
||
25 | { |
||
26 | $em = $this->createMock(EntityManager::class); |
||
27 | $em->expects($this->any()) |
||
28 | ->method($this->anything()) |
||
29 | ->willReturn($em); |
||
30 | |||
31 | $acl = $this->createMock(AclHelper::class); |
||
32 | |||
33 | $this->object = new AbstractArticleAuthorAdminListConfigurator($em, $acl, 'nl', 'admin'); |
||
0 ignored issues
–
show
|
|||
34 | } |
||
35 | |||
36 | public function testGetters() |
||
37 | { |
||
38 | $this->assertEquals('KunstmaanArticleBundle', $this->object->getBundleName()); |
||
39 | $this->assertEquals('AbstractArticleAuthor', $this->object->getEntityName()); |
||
40 | } |
||
41 | |||
42 | public function testBuildFields() |
||
43 | { |
||
44 | $this->object->buildFields(); |
||
45 | $this->object->buildFilters(); |
||
46 | $fields = $this->object->getFields(); |
||
47 | $this->assertCount(2, $fields); |
||
48 | } |
||
49 | } |
||
50 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.