Backoffice/Tests/BusinessRules/Strategies/KeywordStrategyTest.php
Avoid using static access to class '\Phake' in method 'testCanDelete'. Open
Open
$keyword = Phake::mock('OpenOrchestra\ModelInterface\Model\KeywordInterface');
- 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 undeclared method \OpenOrchestra\BackOffice\Tests\BusinessRules\Strategies\KeywordStrategyTest::assertSame
Open
Open
$this->assertSame($isGranted, $this->strategy->canDelete($keyword, array()));
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
Open
$keyword = Phake::mock('OpenOrchestra\ModelInterface\Model\KeywordInterface');
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant ENTITY_TYPE
from undeclared class \OpenOrchestra\ModelInterface\Model\KeywordInterface
Open
Open
$this->assertEquals(KeywordInterface::ENTITY_TYPE, $this->strategy->getType());
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\BackOffice\Tests\BusinessRules\Strategies\KeywordStrategyTest::assertEquals
Open
Open
$this->assertEquals(KeywordInterface::ENTITY_TYPE, $this->strategy->getType());
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Open
Phake::when($keyword)->isUsed()->thenReturn($isUsed);
- Create a ticketCreate a ticket
- Exclude checks
Class extends undeclared class \OpenOrchestra\BaseBundle\Tests\AbstractTest\AbstractBaseTestCase
Open
Open
class KeywordStrategyTest extends AbstractBaseTestCase
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\BackOffice\Tests\BusinessRules\Strategies\KeywordStrategyTest::assertEquals
Open
Open
$this->assertEquals(array(
- Create a ticketCreate a ticket
- Exclude checks
Saw an @param annotation for countByKeyword,
but it was not found in the param list of function testCanDelete($isUsed, $isGranted)
Open
Open
* @param bool $countByKeyword
- Create a ticketCreate a ticket
- Exclude checks