Method setUp
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setUp()
{
$context = Phake::mock('OpenOrchestra\Backoffice\Context\ContextBackOfficeInterface');
$repository = Phake::mock('OpenOrchestra\ModelInterface\Repository\NodeRepositoryInterface');
- Create a ticketCreate a ticket
Method testGetPerimeterConfiguration
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testGetPerimeterConfiguration()
{
$result = $this->strategy->getPerimeterConfiguration('siteId');
$this->assertEquals(array(
- Create a ticketCreate a ticket
Avoid using static access to class '\Phake' in method 'setUp'. Open
$context = Phake::mock('OpenOrchestra\Backoffice\Context\ContextBackOfficeInterface');
- 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 'setUp'. Open
Phake::when($repository)->findTreeNode(Phake::anyParameters())->thenReturn(array(
- 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 'setUp'. Open
$repository = Phake::mock('OpenOrchestra\ModelInterface\Repository\NodeRepositoryInterface');
- 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 anyParameters
from undeclared class \Phake
Open
Phake::when($repository)->findTreeNode(Phake::anyParameters())->thenReturn(array(
- Create a ticketCreate a ticket
- Exclude checks
Class extends undeclared class \OpenOrchestra\BaseBundle\Tests\AbstractTest\AbstractBaseTestCase
Open
class NodeGeneratePerimeterStrategyTest extends AbstractBaseTestCase
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($repository)->findTreeNode(Phake::anyParameters())->thenReturn(array(
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$context = Phake::mock('OpenOrchestra\Backoffice\Context\ContextBackOfficeInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\Form\Type\Component\NodeGeneratePerimeterStrategyTest::assertEquals
Open
$this->assertEquals(NodeInterface::ENTITY_TYPE, $result);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\Form\Type\Component\NodeGeneratePerimeterStrategyTest::assertEquals
Open
$this->assertEquals(array(
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$repository = Phake::mock('OpenOrchestra\ModelInterface\Repository\NodeRepositoryInterface');
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant ENTITY_TYPE
from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open
$this->assertEquals(NodeInterface::ENTITY_TYPE, $result);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\Form\Type\Component\NodeGeneratePerimeterStrategyTest::assertEquals
Open
$this->assertEquals(array(
- Create a ticketCreate a ticket
- Exclude checks