open-orchestra/open-orchestra-cms-bundle

View on GitHub
ApiBundle/Tests/Transformer/NodeTransformerTest.php

Summary

Maintainability
A
1 hr
Test Coverage

Method setUp has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function setUp()
    {
        $this->eventDispatcher = Phake::mock('Symfony\Component\EventDispatcher\EventDispatcherInterface');

        $this->node = Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface');
Severity: Minor
Found in ApiBundle/Tests/Transformer/NodeTransformerTest.php - About 1 hr to fix

The class NodeTransformerTest has 16 fields. Consider redesigning NodeTransformerTest to keep the number of fields under 15.
Open

class NodeTransformerTest extends AbstractBaseTestCase
{
    /**
     * @var NodeTransformer
     */

TooManyFields

Since: 0.1

Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

Example

class Person {
   protected $one;
   private $two;
   private $three;
   [... many more fields ...]
}

Source https://phpmd.org/rules/codesize.html#toomanyfields

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

        $this->eventDispatcher = Phake::mock('Symfony\Component\EventDispatcher\EventDispatcherInterface');

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

        $siteAlias = Phake::mock('OpenOrchestra\ModelInterface\Model\SiteAliasInterface');

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($this->authorizationChecker)->isGranted(Phake::anyParameters())->thenReturn(true);

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 'testTransform'.
Open

        Phake::verify($this->router, Phake::times(1))->generate(Phake::anyParameters());

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 'testTransformNotGranted'.
Open

        Phake::when($this->transformerManager)->transform(Phake::anyParameters())->thenReturn($facade);

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 'testReverseTransform'.
Open

            Phake::verify($source, Phake::times($setCount))->setStatus(Phake::anyParameters());

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($this->router)->generate(Phake::anyParameters())->thenReturn('route');

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($this->businessRulesManager)->isGranted(Phake::anyParameters())->thenReturn(true);

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

        $this->transformer = Phake::mock('OpenOrchestra\ApiBundle\Transformer\BlockTransformer');

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

        $this->nodeRepository = 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

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

        Phake::when($this->transformerManager)->transform(Phake::anyParameters())->thenReturn($facade);

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

        $this->siteRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\SiteRepositoryInterface');

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($this->siteRepository)->findOneBySiteId(Phake::anyParameters())->thenReturn($this->site);

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 'testTransform'.
Open

        Phake::verify($this->siteRepository, Phake::times(2))->findOneBySiteId(Phake::anyParameters());

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 'getChangeStatus'.
Open

        $node = Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface');

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($this->statusRepository)->find(Phake::anyParameters())->thenReturn($this->status);

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

        $groupContext = Phake::mock('OpenOrchestra\BaseApi\Context\GroupContext');

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 'testTransformNotGranted'.
Open

        Phake::verify($this->siteRepository, Phake::times(2))->findOneBySiteId(Phake::anyParameters());

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 'getChangeStatus'.
Open

        $status = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');

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($groupContext)->hasGroup(Phake::anyParameters())->thenReturn(true);

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

        $this->businessRulesManager = Phake::mock('OpenOrchestra\Backoffice\BusinessRules\BusinessRulesManager');

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

        $this->encryptionManager = Phake::mock('OpenOrchestra\BaseBundle\Manager\EncryptionManager');

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

        $this->transformerManager = Phake::mock('OpenOrchestra\BaseApi\Transformer\TransformerManager');

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($this->transformerManager)->get(Phake::anyParameters())->thenReturn($this->transformer);

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

        $this->authorizationChecker = Phake::mock('Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface');

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 'testTransform'.
Open

        Phake::verify($this->siteRepository, Phake::times(2))->findOneBySiteId(Phake::anyParameters());

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 'testReverseTransform'.
Open

        Phake::verify($this->statusRepository, Phake::times($searchCount))->find(Phake::anyParameters());

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 'testReverseTransform'.
Open

            Phake::verify($source, Phake::times($setCount))->setStatus(Phake::anyParameters());

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 'getChangeStatus'.
Open

        $facadeA = Phake::mock('OpenOrchestra\ApiBundle\Facade\NodeFacade');

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

        $this->node = Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface');

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 'testTransform'.
Open

        $facade = Phake::mock('OpenOrchestra\BaseApi\Facade\FacadeInterface');

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

        $this->status = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');

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

        $this->statusRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\StatusRepositoryInterface');

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 'testTransform'.
Open

        Phake::verify($this->router, Phake::times(1))->generate(Phake::anyParameters());

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 'testTransformNotGranted'.
Open

        Phake::verify($this->siteRepository, Phake::times(2))->findOneBySiteId(Phake::anyParameters());

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 'testReverseTransform'.
Open

        Phake::verify($this->statusRepository, Phake::times($searchCount))->find(Phake::anyParameters());

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 'getChangeStatus'.
Open

        $facadeB = Phake::mock('OpenOrchestra\ApiBundle\Facade\NodeFacade');

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 'getChangeStatus'.
Open

        $facadeStatus = Phake::mock('OpenOrchestra\WorkflowAdminBundle\Facade\StatusFacade');

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

        $status = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');

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 'testTransformNotGranted'.
Open

        Phake::verify($this->router, Phake::times(1))->generate(Phake::anyParameters());

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 'testExceptionTransform'.
Open

        $this->nodeTransformer->transform(Phake::mock('stdClass'));

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

        $this->router = Phake::mock('Symfony\Component\Routing\RouterInterface');

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 'testTransformNotGranted'.
Open

        Phake::when($this->authorizationChecker)->isGranted(Phake::anyParameters())->thenReturn(false);

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 'testTransformNotGranted'.
Open

        $area = Phake::mock('OpenOrchestra\ModelInterface\Model\AreaInterface');

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 'testTransformNotGranted'.
Open

        Phake::verify($this->router, Phake::times(1))->generate(Phake::anyParameters());

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

        $this->site = Phake::mock('OpenOrchestra\ModelInterface\Model\SiteInterface');

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($this->status)->getId(Phake::anyParameters())->thenReturn($this->statusId);

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 'testTransform'.
Open

        $area = Phake::mock('OpenOrchestra\ModelInterface\Model\AreaInterface');

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 'testTransformNotGranted'.
Open

        $facade = Phake::mock('OpenOrchestra\BaseApi\Facade\FacadeInterface');

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($this->router)->generate(Phake::anyParameters())->thenReturn('route');

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->transformerManager)->transform(Phake::anyParameters())->thenReturn($facade);

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->siteRepository, Phake::times(2))->findOneBySiteId(Phake::anyParameters());

Call to method times from undeclared class \Phake
Open

            Phake::verify($source, Phake::times($setCount))->setStatus(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

        $node = Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface');

Call to method mock from undeclared class \Phake
Open

        $this->eventDispatcher = Phake::mock('Symfony\Component\EventDispatcher\EventDispatcherInterface');

Call to method mock from undeclared class \Phake
Open

        $this->status = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->transformer)->getContext()->thenReturn($this->transformerManager);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->authorizationChecker)->isGranted(Phake::anyParameters())->thenReturn(false);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->transformerManager)->transform('area', $area);

Call to method mock from undeclared class \Phake
Open

        $siteAlias = Phake::mock('OpenOrchestra\ModelInterface\Model\SiteAliasInterface');

Call to method mock from undeclared class \Phake
Open

        $this->router = Phake::mock('Symfony\Component\Routing\RouterInterface');

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->transformerManager)->get(Phake::anyParameters())->thenReturn($this->transformer);

Call to method mock from undeclared class \Phake
Open

        $this->authorizationChecker = Phake::mock('Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface');

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->authorizationChecker)->isGranted(Phake::anyParameters())->thenReturn(true);

Call to method verify from undeclared class \Phake
Open

            Phake::verify($source, Phake::times($setCount))->setStatus(Phake::anyParameters());

Call to undeclared method \OpenOrchestra\ApiBundle\Transformer\NodeTransformer::setContext
Open

        $this->nodeTransformer->setContext($this->transformerManager);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->siteRepository, Phake::times(2))->findOneBySiteId(Phake::anyParameters());

Call to undeclared method \OpenOrchestra\ApiBundle\Tests\Transformer\NodeTransformerTest::assertSame
Open

        $this->assertSame($facade->getRights()['can_read'], false);

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->statusRepository, Phake::times($searchCount))->find(Phake::anyParameters());

Call to undeclared method \OpenOrchestra\ApiBundle\Tests\Transformer\NodeTransformerTest::expectException
Open

        $this->expectException('OpenOrchestra\BaseApi\Exceptions\TransformerParameterTypeException');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->status)->getId(Phake::anyParameters())->thenReturn($this->statusId);

Call to method mock from undeclared class \Phake
Open

        $this->businessRulesManager = Phake::mock('OpenOrchestra\Backoffice\BusinessRules\BusinessRulesManager');

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->authorizationChecker)->isGranted(Phake::anyParameters())->thenReturn(false);

Call to method mock from undeclared class \Phake
Open

        $area = Phake::mock('OpenOrchestra\ModelInterface\Model\AreaInterface');

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->router, Phake::times(1))->generate(Phake::anyParameters());

Call to method anyParameters from undeclared class \Phake
Open

            Phake::verify($source, Phake::times($setCount))->setStatus(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

        $status = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($node)->getStatus()->thenReturn($status);

Call to method mock from undeclared class \Phake
Open

        $this->encryptionManager = Phake::mock('OpenOrchestra\BaseBundle\Manager\EncryptionManager');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->statusRepository)->find(Phake::anyParameters())->thenReturn($this->status);

Call to method mock from undeclared class \Phake
Open

        $this->transformerManager = Phake::mock('OpenOrchestra\BaseApi\Transformer\TransformerManager');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->transformerManager)->get(Phake::anyParameters())->thenReturn($this->transformer);

Call to method mock from undeclared class \Phake
Open

        $this->nodeTransformer->transform(Phake::mock('stdClass'));

Call to method mock from undeclared class \Phake
Open

        $status = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->siteRepository)->findOneBySiteId(Phake::anyParameters())->thenReturn($this->site);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->siteRepository, Phake::times(2))->findOneBySiteId(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

        $this->siteRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\SiteRepositoryInterface');

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->statusRepository)->find(Phake::anyParameters())->thenReturn($this->status);

Call to method mock from undeclared class \Phake
Open

        $this->transformer = Phake::mock('OpenOrchestra\ApiBundle\Transformer\BlockTransformer');

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->router, Phake::times(1))->generate(Phake::anyParameters());

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->status)->getId(Phake::anyParameters())->thenReturn($this->statusId);

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->router, Phake::times(1))->generate(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

        $facadeStatus = Phake::mock('OpenOrchestra\WorkflowAdminBundle\Facade\StatusFacade');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->transformerManager)->getRouter()->thenReturn($this->router);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->businessRulesManager)->isGranted(Phake::anyParameters())->thenReturn(true);

Call to method mock from undeclared class \Phake
Open

        $facade = Phake::mock('OpenOrchestra\BaseApi\Facade\FacadeInterface');

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->transformerManager)->transform(Phake::anyParameters())->thenReturn($facade);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->transformerManager)->transform(Phake::anyParameters())->thenReturn($facade);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->siteRepository)->findOneBySiteId(Phake::anyParameters())->thenReturn($this->site);

Call to method mock from undeclared class \Phake
Open

        $this->statusRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\StatusRepositoryInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->transformerManager)->getGroupContext()->thenReturn($groupContext);

Call to undeclared method \OpenOrchestra\ApiBundle\Tests\Transformer\NodeTransformerTest::assertInstanceOf
Open

        $this->assertInstanceOf('OpenOrchestra\ApiBundle\Facade\NodeFacade', $facade);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->siteRepository, Phake::times(2))->findOneBySiteId(Phake::anyParameters());

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->siteRepository, Phake::times(2))->findOneBySiteId(Phake::anyParameters());

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

class NodeTransformerTest extends AbstractBaseTestCase

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->router)->generate(Phake::anyParameters())->thenReturn('route');

Call to method mock from undeclared class \Phake
Open

        $area = Phake::mock('OpenOrchestra\ModelInterface\Model\AreaInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->node)->getAreas()->thenReturn(array($area));

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->router, Phake::times(1))->generate(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

        $facadeB = Phake::mock('OpenOrchestra\ApiBundle\Facade\NodeFacade');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->site)->getAliases()->thenReturn(array($siteAlias));

Call to method mock from undeclared class \Phake
Open

        $groupContext = Phake::mock('OpenOrchestra\BaseApi\Context\GroupContext');

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($groupContext)->hasGroup(Phake::anyParameters())->thenReturn(true);

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->siteRepository, Phake::times(2))->findOneBySiteId(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

        $facade = Phake::mock('OpenOrchestra\BaseApi\Facade\FacadeInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->node)->getAreas()->thenReturn(array($area));

Call to method when from undeclared class \Phake
Open

        Phake::when($this->node)->getStatus()->thenReturn($status);

Call to method when from undeclared class \Phake
Open

        Phake::when($status)->isPublishedState()->thenReturn(false);

Call to method mock from undeclared class \Phake
Open

        $this->nodeRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\NodeRepositoryInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($groupContext)->hasGroup(Phake::anyParameters())->thenReturn(true);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->authorizationChecker)->isGranted(Phake::anyParameters())->thenReturn(true);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->transformerManager)->transform(Phake::anyParameters())->thenReturn($facade);

Call to method when from undeclared class \Phake
Open

        Phake::when($status)->getId()->thenReturn('otherFakeId');

Call to undeclared method \OpenOrchestra\ApiBundle\Tests\Transformer\NodeTransformerTest::assertSame
Open

        $this->assertSame('node', $this->nodeTransformer->getName());

Call to method when from undeclared class \Phake
Open

        Phake::when($this->businessRulesManager)->isGranted(Phake::anyParameters())->thenReturn(true);

Call to undeclared method \OpenOrchestra\ApiBundle\Tests\Transformer\NodeTransformerTest::assertInstanceOf
Open

        $this->assertInstanceOf('OpenOrchestra\ApiBundle\Facade\NodeFacade', $facade);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->transformerManager)->transform('area', $area);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->transformer)->getContext()->thenReturn($this->transformerManager);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->router, Phake::times(1))->generate(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

        $facadeA = Phake::mock('OpenOrchestra\ApiBundle\Facade\NodeFacade');

Call to method mock from undeclared class \Phake
Open

        $this->node = Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface');

Call to method mock from undeclared class \Phake
Open

        $this->site = Phake::mock('OpenOrchestra\ModelInterface\Model\SiteInterface');

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->router, Phake::times(1))->generate(Phake::anyParameters());

Call to method getRights from undeclared class \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open

        $this->assertSame($facade->getRights()['can_read'], false);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->statusRepository, Phake::times($searchCount))->find(Phake::anyParameters());

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->statusRepository, Phake::times($searchCount))->find(Phake::anyParameters());

Line exceeds 120 characters; contains 129 characters
Open

        $this->authorizationChecker = Phake::mock('Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface');

There are no issues that match your filters.

Category
Status