open-orchestra/open-orchestra-cms-bundle

View on GitHub
Backoffice/Tests/GeneratePerimeter/Strategy/NodeGeneratePerimeterStrategyTest.php

Summary

Maintainability
B
4 hrs
Test Coverage

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');

Method testGetPerimeterConfiguration has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testGetPerimeterConfiguration()
    {
        $result = $this->strategy->getPerimeterConfiguration('siteId');

        $this->assertEquals(array(

Avoid using static access to class '\Phake' in method 'setUp'.
Open

        $context = Phake::mock('OpenOrchestra\Backoffice\Context\ContextBackOfficeInterface');

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(

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');

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(

Class extends undeclared class \OpenOrchestra\BaseBundle\Tests\AbstractTest\AbstractBaseTestCase
Open

class NodeGeneratePerimeterStrategyTest extends AbstractBaseTestCase

Call to method when from undeclared class \Phake
Open

        Phake::when($repository)->findTreeNode(Phake::anyParameters())->thenReturn(array(

Call to method mock from undeclared class \Phake
Open

        $context = Phake::mock('OpenOrchestra\Backoffice\Context\ContextBackOfficeInterface');

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Form\Type\Component\NodeGeneratePerimeterStrategyTest::assertEquals
Open

        $this->assertEquals(NodeInterface::ENTITY_TYPE, $result);

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Form\Type\Component\NodeGeneratePerimeterStrategyTest::assertEquals
Open

        $this->assertEquals(array(

Call to method mock from undeclared class \Phake
Open

        $repository = Phake::mock('OpenOrchestra\ModelInterface\Repository\NodeRepositoryInterface');

Reference to constant ENTITY_TYPE from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $this->assertEquals(NodeInterface::ENTITY_TYPE, $result);

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Form\Type\Component\NodeGeneratePerimeterStrategyTest::assertEquals
Open

        $this->assertEquals(array(

There are no issues that match your filters.

Category
Status