Failed Conditions
Push — preview_pr236 ( 69ee07...f370cd )
by Guilherme
13:30
created

UserClaimsTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getEntityManager() 0 3 1
A testGetUserClaims() 0 3 1
1
<?php
2
/**
3
 * This file is part of the login-cidadao project or it's bundles.
4
 *
5
 * (c) Guilherme Donato <guilhermednt on github>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace LoginCidadao\OpenIDBundle\Tests\Storage;
12
13
use Doctrine\ORM\EntityManager;
14
use LoginCidadao\OpenIDBundle\Storage\UserClaims;
15
16
class UserClaimsTest extends \PHPUnit_Framework_TestCase
17
{
18
19
    public function testGetUserClaims()
20
    {
21
        $this->assertNull((new UserClaims($this->getEntityManager()))->getUserClaims('user_id', 'scope1'));
0 ignored issues
show
Bug introduced by
Are you sure the usage of new LoginCidadao\OpenIDB...ms('user_id', 'scope1') targeting LoginCidadao\OpenIDBundl...Claims::getUserClaims() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
22
    }
23
24
    /**
25
     * @return EntityManager|\PHPUnit_Framework_MockObject_MockObject
26
     */
27
    private function getEntityManager()
28
    {
29
        return $this->getMockBuilder('Doctrine\ORM\EntityManager')->disableOriginalConstructor()->getMock();
30
    }
31
}
32