open-orchestra/open-orchestra-cms-bundle

View on GitHub
Backoffice/Tests/Manager/RedirectionManagerTest.php

Summary

Maintainability
A
1 hr
Test Coverage

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

    public function setUp()
    {
        $this->redirectionClass = 'OpenOrchestra\ModelBundle\Document\Redirection';

        $this->contextManager = Phake::mock('OpenOrchestra\Backoffice\Context\ContextBackOfficeInterface');
Severity: Minor
Found in Backoffice/Tests/Manager/RedirectionManagerTest.php - About 1 hr to fix

The class RedirectionManagerTest has 19 fields. Consider redesigning RedirectionManagerTest to keep the number of fields under 15.
Open

class RedirectionManagerTest extends AbstractBaseTestCase
{
    /**
     * @var RedirectionManager
     */

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->nodeSource = 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->nodeRepository)->findPublishedSortedByVersion(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

        $this->documentManager = Phake::mock('Doctrine\ODM\MongoDB\DocumentManager');

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->siteAlias1 = 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

        $redirection1 = Phake::mock('OpenOrchestra\ModelInterface\Model\RedirectionInterface');

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

        Phake::verify($this->documentManager, Phake::times(2))->persist(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->siteAlias3 = 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->nodeRepository)->findOnePublished(Phake::anyParameters())->thenReturn(null);

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

        Phake::verify($this->documentManager, Phake::times(5))->flush(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->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

        $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 'testGenerateRedirectionForNode'.
Open

        Phake::verify($this->documentManager, Phake::times(2))->persist(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->redirectionRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\RedirectionRepositoryInterface');

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

        $redirection3 = Phake::mock('OpenOrchestra\ModelInterface\Model\RedirectionInterface');

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

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

        $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 'testDeleteRedirection'.
Open

        Phake::verify($this->documentManager, Phake::times(3))->flush(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 'testGenerateRedirectionForNode'.
Open

        Phake::verify($this->documentManager, Phake::times(5))->flush(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 'testGenerateRedirectionForNode'.
Open

        Phake::verify($this->eventDispatcher, Phake::times(5))->dispatch(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 'testCreateRedirection'.
Open

        Phake::verify($this->documentManager, Phake::times(2))->persist(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 'testCreateRedirection'.
Open

        Phake::verify($this->documentManager, Phake::times(2))->flush(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 'testDeleteRedirection'.
Open

        Phake::verify($this->documentManager, Phake::times(3))->flush(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 'testDeleteRedirection'.
Open

        Phake::verify($this->eventDispatcher, Phake::times(3))->dispatch(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

        $nodeCopy = 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 'testCreateRedirection'.
Open

        Phake::verify($this->eventDispatcher, Phake::times(2))->dispatch(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->contextManager = 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 'testCreateRedirection'.
Open

        Phake::verify($this->eventDispatcher, Phake::times(2))->dispatch(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 'testDeleteRedirection'.
Open

        Phake::verify($this->documentManager, Phake::times(3))->remove(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

        $redirection2 = Phake::mock('OpenOrchestra\ModelInterface\Model\RedirectionInterface');

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->redirectionRepository)->findByNode(Phake::anyParameters())->thenReturn($redirections);

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

        Phake::verify($this->documentManager, Phake::times(2))->persist(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 'testCreateRedirection'.
Open

        Phake::verify($this->siteAlias3, Phake::never())->getPrefix();

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

        Phake::verify($this->documentManager, Phake::times(3))->remove(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 'testDeleteRedirection'.
Open

        Phake::verify($this->eventDispatcher, Phake::times(3))->dispatch(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 'testGenerateRedirectionForNode'.
Open

        Phake::verify($this->eventDispatcher, Phake::times(5))->dispatch(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 'testCreateRedirection'.
Open

        Phake::verify($this->documentManager, Phake::times(2))->flush(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

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->nodeRepository)->findPublishedSortedByVersion(Phake::anyParameters())->thenReturn(array(

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->eventDispatcher, Phake::times(2))->dispatch(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($this->siteAlias1)->getLanguage()->thenReturn($this->localeFr);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->redirectionRepository)->findByNode(Phake::anyParameters())->thenReturn($redirections);

Call to method when from undeclared class \Phake
Open

        Phake::when($nodeCopy)->getSideId()->thenReturn($this->siteId);

Call to method when from undeclared class \Phake
Open

        Phake::when($nodeCopy)->getRoutePattern()->thenReturn($this->otherNodeRoutePattern);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->documentManager, Phake::times(2))->flush(Phake::anyParameters());

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->eventDispatcher, Phake::times(3))->dispatch(Phake::anyParameters());

Call to method anyParameters from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($this->nodeSource)->getSideId()->thenReturn($this->siteId);

Call to method when from undeclared class \Phake
Open

        Phake::when($nodeCopy)->getLanguage()->thenReturn($this->localeFr);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->documentManager, Phake::times(5))->flush(Phake::anyParameters());

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->documentManager, Phake::times(5))->flush(Phake::anyParameters());

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->documentManager, Phake::times(3))->flush(Phake::anyParameters());

Call to method when from undeclared class \Phake
Open

        Phake::when($this->siteAlias2)->getLanguage()->thenReturn($this->localeFr);

Call to method mock from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($this->nodeSource)->getLanguage()->thenReturn($this->localeFr);

Call to method mock from undeclared class \Phake
Open

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

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->siteAlias2)->getPrefix();

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->documentManager, Phake::times(2))->persist(Phake::anyParameters());

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->documentManager, Phake::times(2))->flush(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

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

Call to method __construct from undeclared class \Doctrine\Common\Collections\ArrayCollection
Open

        $redirections = new ArrayCollection(array($redirection1, $redirection2, $redirection3));

Call to method mock from undeclared class \Phake
Open

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

Call to method mock from undeclared class \Phake
Open

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

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->documentManager, Phake::times(3))->remove(Phake::anyParameters());

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->documentManager, Phake::times(3))->flush(Phake::anyParameters());

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->nodeSource = Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface');

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->siteAlias3, Phake::never())->getPrefix();

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->documentManager, Phake::times(3))->remove(Phake::anyParameters());

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->documentManager, Phake::times(3))->flush(Phake::anyParameters());

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->eventDispatcher, Phake::times(5))->dispatch(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

        $redirection3 = Phake::mock('OpenOrchestra\ModelInterface\Model\RedirectionInterface');

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->siteAlias1)->getPrefix();

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->eventDispatcher, Phake::times(5))->dispatch(Phake::anyParameters());

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

class RedirectionManagerTest extends AbstractBaseTestCase

Call to method when from undeclared class \Phake
Open

        Phake::when($this->contextManager)->getSiteId()->thenReturn($this->siteId);

Call to method when from undeclared class \Phake
Open

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

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->documentManager, Phake::times(2))->persist(Phake::anyParameters());

Call to method when from undeclared class \Phake
Open

        Phake::when($this->siteAlias2)->getPrefix()->thenReturn($this->localeFr);

Call to method __construct from undeclared class \Doctrine\Common\Collections\ArrayCollection
Open

        $siteAliases = new ArrayCollection(array($this->siteAlias1, $this->siteAlias2, $this->siteAlias3));

Call to method when from undeclared class \Phake
Open

        Phake::when($this->nodeSource)->getRoutePattern()->thenReturn($this->nodeRoutePattern);

Call to method mock from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($this->siteAlias3)->getLanguage()->thenReturn($this->localeEn);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->nodeSource)->getNodeId()->thenReturn($this->nodeId);

Call to method when from undeclared class \Phake
Open

        Phake::when($nodeCopy)->getNodeId()->thenReturn($this->nodeId);

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->documentManager, Phake::times(2))->persist(Phake::anyParameters());

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->eventDispatcher, Phake::times(2))->dispatch(Phake::anyParameters());

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->eventDispatcher, Phake::times(3))->dispatch(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

        $this->contextManager = Phake::mock('OpenOrchestra\Backoffice\Context\ContextBackOfficeInterface');

Call to method mock from undeclared class \Phake
Open

        $redirection2 = Phake::mock('OpenOrchestra\ModelInterface\Model\RedirectionInterface');

Call to method mock from undeclared class \Phake
Open

        $this->documentManager = Phake::mock('Doctrine\ODM\MongoDB\DocumentManager');

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->documentManager, Phake::times(2))->persist(Phake::anyParameters());

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->documentManager, Phake::times(5))->flush(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

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

Call to method mock from undeclared class \Phake
Open

        $redirection1 = Phake::mock('OpenOrchestra\ModelInterface\Model\RedirectionInterface');

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->redirectionRepository)->findByNode(Phake::anyParameters())->thenReturn($redirections);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->nodeRepository)->findPublishedSortedByVersion(Phake::anyParameters())->thenReturn(array(

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->nodeRepository)->findOnePublished(Phake::anyParameters())->thenReturn(null);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->nodeRepository)->findOnePublished(Phake::anyParameters())->thenReturn(null);

Call to method never from undeclared class \Phake
Open

        Phake::verify($this->siteAlias3, Phake::never())->getPrefix();

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->eventDispatcher, Phake::times(2))->dispatch(Phake::anyParameters());

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->eventDispatcher, Phake::times(3))->dispatch(Phake::anyParameters());

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->documentManager, Phake::times(2))->flush(Phake::anyParameters());

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->documentManager, Phake::times(2))->persist(Phake::anyParameters());

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->documentManager, Phake::times(2))->persist(Phake::anyParameters());

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->documentManager, Phake::times(3))->remove(Phake::anyParameters());

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->eventDispatcher, Phake::times(5))->dispatch(Phake::anyParameters());

Avoid excessively long variable names like $redirectionRepository. Keep variable name length under 20.
Open

    protected $redirectionRepository;

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $otherNodeRoutePattern. Keep variable name length under 20.
Open

    protected $otherNodeRoutePattern = 'otherFakeRoutePattern';

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Line exceeds 120 characters; contains 125 characters
Open

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

There are no issues that match your filters.

Category
Status