Method provideStatusAndUsage
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function provideStatusAndUsage()
{
$status0 = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');
Phake::when($status0)->isInitialState()->thenReturn(true);
Phake::when($status0)->isPublishedState()->thenReturn(false);
- Create a ticketCreate a ticket
Avoid using static access to class '\Phake' in method 'setUp'. Open
$this->statusUsageFinder = Phake::mock('OpenOrchestra\Backoffice\UsageFinder\StatusUsageFinder');
- 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 'provideStatusAndUsage'. Open
$status2 = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');
- 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 'provideStatusAndUsage'. Open
$status4 = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');
- 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 'provideStatusAndUsage'. Open
$status1 = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');
- 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 'provideStatusAndUsage'. Open
$status5 = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');
- 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 'testCanDelete'. Open
Phake::when($this->statusUsageFinder)->hasUsage(Phake::anyParameters())->thenReturn($hasUsage);
- 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 'provideStatusAndUsage'. Open
$status0 = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');
- 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 'provideStatusAndUsage'. Open
$status3 = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');
- 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
Phake::when($status5)->isPublishedState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Call to method anyParameters
from undeclared class \Phake
Open
Phake::when($this->statusUsageFinder)->hasUsage(Phake::anyParameters())->thenReturn($hasUsage);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status0)->isInitialState()->thenReturn(true);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status4)->isAutoPublishFromState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\GroupBundle\Tests\BusinessRules\Strategies\StatusStrategyTest::assertEquals
Open
$this->assertEquals(StatusInterface::ENTITY_TYPE, $this->strategy->getType());
- Create a ticketCreate a ticket
- Exclude checks
Class extends undeclared class \OpenOrchestra\BaseBundle\Tests\AbstractTest\AbstractBaseTestCase
Open
class StatusStrategyTest extends AbstractBaseTestCase
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$this->statusUsageFinder = Phake::mock('OpenOrchestra\Backoffice\UsageFinder\StatusUsageFinder');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($this->statusUsageFinder)->hasUsage(Phake::anyParameters())->thenReturn($hasUsage);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status0)->isTranslationState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status0)->isPublishedState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$status2 = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status3)->isTranslationState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status4)->isPublishedState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status5)->isInitialState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Reference to undeclared property \OpenOrchestra\GroupBundle\Tests\BusinessRules\Strategies\StatusStrategyTest->strategy
Open
), $this->strategy->getActions());
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status2)->isPublishedState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$status4 = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status4)->isTranslationState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Parameter $status
has undeclared type \OpenOrchestra\ModelInterface\Model\StatusInterface
Open
public function testCanDelete(StatusInterface $status, $hasUsage, $isGranted)
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status0)->isAutoUnpublishToState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status3)->isAutoPublishFromState()->thenReturn(true);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status3)->isAutoUnpublishToState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$status5 = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status3)->isInitialState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status4)->isAutoUnpublishToState()->thenReturn(true);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status5)->isAutoPublishFromState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status5)->isAutoUnpublishToState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status1)->isTranslationState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status1)->isAutoUnpublishToState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$status0 = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status0)->isAutoPublishFromState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status2)->isAutoUnpublishToState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\GroupBundle\Tests\BusinessRules\Strategies\StatusStrategyTest::assertEquals
Open
$this->assertEquals(array(
- Create a ticketCreate a ticket
- Exclude checks
Reference to undeclared property \OpenOrchestra\GroupBundle\Tests\BusinessRules\Strategies\StatusStrategyTest->strategy
Open
$this->strategy = new StatusStrategy($this->statusUsageFinder);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status1)->isInitialState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status1)->isAutoPublishFromState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant ENTITY_TYPE
from undeclared class \OpenOrchestra\ModelInterface\Model\StatusInterface
Open
$this->assertEquals(StatusInterface::ENTITY_TYPE, $this->strategy->getType());
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status2)->isAutoPublishFromState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Reference to undeclared property \OpenOrchestra\GroupBundle\Tests\BusinessRules\Strategies\StatusStrategyTest->strategy
Open
$this->assertEquals(StatusInterface::ENTITY_TYPE, $this->strategy->getType());
- Create a ticketCreate a ticket
- Exclude checks
Reference to undeclared property \OpenOrchestra\GroupBundle\Tests\BusinessRules\Strategies\StatusStrategyTest->strategy
Open
$this->assertSame($isGranted, $this->strategy->canDelete($status, array()));
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\GroupBundle\Tests\BusinessRules\Strategies\StatusStrategyTest::assertSame
Open
$this->assertSame($isGranted, $this->strategy->canDelete($status, array()));
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status2)->isInitialState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status2)->isTranslationState()->thenReturn(true);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status3)->isPublishedState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$status1 = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$status3 = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status1)->isPublishedState()->thenReturn(true);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status4)->isInitialState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status5)->isTranslationState()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks