UserAdminBundle/Tests/Security/OrchestraUserCheckerTest.php
Avoid using static access to class '\Phake' in method 'testCheckPreAuthNotOrchestraUserInterface'. Open
Open
$user = Phake::mock(UserInterface::class);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Phake' in method 'createMockUser'. Open
Open
$user = Phake::mock('OpenOrchestra\UserBundle\Model\UserInterface');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Call to method when
from undeclared class \Phake
Open
Open
Phake::when($user)->isAccountNonLocked()->thenReturn(true);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Open
Phake::when($user)->isAccountNonExpired()->thenReturn(true);
- Create a ticketCreate a ticket
- Exclude checks
Parameter $user
has undeclared type \Symfony\Component\Security\Core\User\UserInterface
Open
Open
public function testCheckPreAuth(UserInterface $user, $expectedException)
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Open
Phake::when($user)->getRoles()->thenReturn($roles);
- Create a ticketCreate a ticket
- Exclude checks
Class extends undeclared class \OpenOrchestra\BaseBundle\Tests\AbstractTest\AbstractBaseTestCase
Open
Open
class OrchestraUserCheckerTest extends AbstractBaseTestCase
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\UserAdminBundle\Tests\Security\OrchestraUserCheckerTest::expectException
Open
Open
$this->expectException('OpenOrchestra\UserAdminBundle\Exception\NoRolesException');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Open
Phake::when($user)->isEnabled()->thenReturn(true);
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant ROLE_DEFAULT
from undeclared class \FOS\UserBundle\Model\UserInterface
Open
Open
$userRoleDefault = $this->createMockUser(array(\FOS\UserBundle\Model\UserInterface::ROLE_DEFAULT));
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Open
Phake::when($user)->isAccountNonExpired()->thenReturn(true);
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant class
from undeclared class \Symfony\Component\Security\Core\User\UserInterface
Open
Open
$user = Phake::mock(UserInterface::class);
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant ROLE_DEFAULT
from undeclared class \FOS\UserBundle\Model\UserInterface
Open
Open
Phake::when($userRoleDefault)->hasRole(\FOS\UserBundle\Model\UserInterface::ROLE_DEFAULT)->thenReturn(true);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\UserAdminBundle\Tests\Security\OrchestraUserCheckerTest::assertNull
Open
Open
$this->assertNull($this->userChecker->checkPreAuth($user));
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Open
Phake::when($user)->isEnabled()->thenReturn(true);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
Open
$user = Phake::mock(UserInterface::class);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Open
Phake::when($userRoleDefault)->hasRole(\FOS\UserBundle\Model\UserInterface::ROLE_DEFAULT)->thenReturn(true);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
Open
$user = Phake::mock('OpenOrchestra\UserBundle\Model\UserInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Open
Phake::when($user)->isAccountNonLocked()->thenReturn(true);
- Create a ticketCreate a ticket
- Exclude checks