open-orchestra/open-orchestra-cms-bundle

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

Summary

Maintainability
A
2 hrs
Test Coverage

The class NodeManagerTest has 13 public methods. Consider refactoring NodeManagerTest to keep number of public methods under 10.
Open

class NodeManagerTest extends AbstractBaseTestCase
{
    /**
     * @var NodeManager
     */

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

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

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

    public function setUp()
    {
        $this->node = Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface');
        $this->area = Phake::mock('OpenOrchestra\ModelInterface\Model\AreaInterface');
        $this->block = Phake::mock('OpenOrchestra\ModelInterface\Model\BlockInterface');
Severity: Minor
Found in Backoffice/Tests/Manager/NodeManagerTest.php - About 2 hrs to fix

The class NodeManagerTest has 20 fields. Consider redesigning NodeManagerTest to keep the number of fields under 15.
Open

class NodeManagerTest extends AbstractBaseTestCase
{
    /**
     * @var NodeManager
     */

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

Method testCreateNewErrorNode has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function testCreateNewErrorNode($nodeId, $name, $parentId, $siteId, $language, $template)
Severity: Minor
Found in Backoffice/Tests/Manager/NodeManagerTest.php - About 45 mins to fix

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

        $this->blockRepository = Phake::mock('OpenOrchestra\ModelBundle\Repository\BlockRepository');

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

        Phake::when($this->nodeRepository)->findInLastVersion(Phake::anyParameters())->thenReturn($this->node);

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->templateManager = Phake::mock('OpenOrchestra\Backoffice\Manager\TemplateManager');

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

        Phake::verify($this->eventDispatcher)->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->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 '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 'setUp'.
Open

        Phake::when($this->siteRepository)->findOneBySiteId(Phake::anyParameters())->thenReturn($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 'testHydrateNodeFromNodeId'.
Open

        $newNode = 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 'testInitializeAreasNode'.
Open

        Phake::verify($node, Phake::times(2))->setArea(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 'testDeleteBlockInNode'.
Open

        Phake::verify($this->documentManager, Phake::never())->remove($this->blockTransverse);

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

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

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

        Phake::verify($this->node, Phake::times(4))->setOrder($position);

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

        Phake::verify($this->node, Phake::times(4))->setParentId($parentNodeId);

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\Common\Persistence\ObjectManager');

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

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

        Phake::when($this->templateManager)->getTemplateAreas(Phake::anyParameters())->thenReturn($areaName);

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

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

        $token = Phake::mock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');

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

        Phake::when($this->nodeRepository)->findVersionNotDeleted(Phake::anyParameters())->thenReturn($parentNode);

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

        Phake::when($this->nodeRepository)->findVersionNotDeleted(Phake::anyParameters())->thenReturn($parentNode);

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

        $parentNode = 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

        $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

        $tokenStorage = Phake::mock('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage');

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

        Phake::verify($node, Phake::times(2))->setArea(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 'testOrderNodeChildren'.
Open

        Phake::verify($this->eventDispatcher)->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 '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 'testInitializeAreasNode'.
Open

        Phake::when($this->siteRepository)->findOneBySiteId(Phake::anyParameters())->thenReturn($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 'setUp'.
Open

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

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->uniqueIdGenerator = Phake::mock('OpenOrchestra\Backoffice\Util\UniqueIdGenerator');

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 'testInitializeAreasNode'.
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 'provideParentNode'.
Open

        $parentNode0 = 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

        $this->user = Phake::mock('OpenOrchestra\UserBundle\Model\UserInterface');

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 unused parameters such as '$nodeId'.
Open

    public function testOrderNodeChildren($position, $nodeId, $parentPath)

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

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

class NodeManagerTest extends AbstractBaseTestCase

Call to method mock from undeclared class \Phake
Open

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

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->contextManager)->getSiteDefaultLanguage()->thenReturn('fakeLanguage');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->blockTransverse)->isTransverse()->thenReturn(true);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->uniqueIdGenerator)->generateUniqueId()->thenReturn($this->fakeVersion);

Reference to constant TYPE_ERROR from undeclared class \OpenOrchestra\ModelInterface\Model\ReadNodeInterface
Open

        $this->assertEquals(ReadNodeInterface::TYPE_ERROR, $newNode->getNodeType());

Call to method when from undeclared class \Phake
Open

        Phake::when($this->node)->getParentId()->thenReturn('nodeParentId');

Call to method verify from undeclared class \Phake
Open

        Phake::verify($newNode)->setStatus($this->status);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($newNode)->setVersionName($versionName);

Call to method isInMenu from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $this->assertEquals(false, $newNode->isInMenu());

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertEquals
Open

        $this->assertEquals($parentId, $newNode->getParentId());

Call to method mock from undeclared class \Phake
Open

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

Possibly zero references to use statement for classlike/namespace ArrayCollection (\Doctrine\Common\Collections\ArrayCollection)
Open

use Doctrine\Common\Collections\ArrayCollection;

Call to method mock from undeclared class \Phake
Open

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

Call to method mock from undeclared class \Phake
Open

        $this->documentManager = Phake::mock('Doctrine\Common\Persistence\ObjectManager');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->block)->isTransverse()->thenReturn(false);

Call to method mock from undeclared class \Phake
Open

        $this->uniqueIdGenerator = Phake::mock('OpenOrchestra\Backoffice\Util\UniqueIdGenerator');

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertEquals
Open

        $this->assertEquals($name, $newNode->getName());

Call to method isInFooter from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $this->assertEquals(false, $newNode->isInFooter());

Call to method getParentId from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $this->assertEquals($parentId, $newNode->getParentId());

Call to method verify from undeclared class \Phake
Open

        Phake::verify($alteredNode)->setSitemapChangefreq(null);

Call to method mock from undeclared class \Phake
Open

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

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->contextManager)->getSiteId()->thenReturn('fakeSiteId');

Call to method when from undeclared class \Phake
Open

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

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertEquals
Open

        $this->assertEquals($nodeId, $newNode->getNodeId());

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertEquals
Open

        $this->assertEquals($siteId, $newNode->getSiteId());

Call to method verify from undeclared class \Phake
Open

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

Call to method getLanguage from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $this->assertEquals($language, $node->getLanguage());

Call to method mock from undeclared class \Phake
Open

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

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertEquals
Open

        $this->assertEquals(false, $newNode->isInFooter());

Call to method when from undeclared class \Phake
Open

        Phake::when($this->nodeRepository)->findInLastVersion(Phake::anyParameters())->thenReturn($this->node);

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertEquals
Open

        $this->assertEquals($userName, $node->getCreatedBy());

Call to method getSiteId from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $this->assertEquals($siteId, $newNode->getSiteId());

Call to method verify from undeclared class \Phake
Open

        Phake::verify($alteredNode)->setSitemapPriority(null);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($newNode)->setTemplate($this->node->getTemplate());

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertInstanceOf
Open

        $this->assertInstanceOf($this->nodeClass, $node);

Call to method getCreatedBy from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $this->assertEquals($userName, $node->getCreatedBy());

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertSame
Open

            $this->assertSame(NodeInterface::ROOT_NODE_ID, $node->getNodeId());

Call to method mock from undeclared class \Phake
Open

        $this->blockRepository = Phake::mock('OpenOrchestra\ModelBundle\Repository\BlockRepository');

Call to method getName from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $this->assertEquals($name, $newNode->getName());

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->nodeRepository)->findVersionNotDeleted(Phake::anyParameters())->thenReturn($parentNode);

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertEquals
Open

        $this->assertEquals($siteId, $node->getSiteId());

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertEquals
Open

        $this->assertEquals($language, $node->getLanguage());

Call to method when from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

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

Call to method verify from undeclared class \Phake
Open

        Phake::verify($newNode)->setVersion($this->fakeVersion);

Call to method getLanguage from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $this->assertEquals($language, $newNode->getLanguage());

Call to method verify from undeclared class \Phake
Open

        Phake::verify($alteredNode)->setMetaFollow(false);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->nodeRepository)->findInLastVersion(Phake::anyParameters())->thenReturn($this->node);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->user)->getUsername()->thenReturn($userName);

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertEquals
Open

        $this->assertEquals(0, $node->getOrder());

Call to method when from undeclared class \Phake
Open

        Phake::when($token)->getUser()->thenReturn($this->user);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($alteredNode)->setVersion($this->fakeVersion);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->nodeRepository)->findVersionNotDeleted(Phake::anyParameters())->thenReturn($parentNode);

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

            $this->assertSame(NodeInterface::TYPE_DEFAULT, $node->getNodeType());

Call to method when from undeclared class \Phake
Open

        Phake::when($this->nodeRepository)->findByNodeAndSite($this->nodeId, $siteId)->thenReturn($sons);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->node, Phake::times(4))->setOrder($position);

Call to method anyParameters from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

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

Call to method mock from undeclared class \Phake
Open

        $token = Phake::mock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertEquals
Open

        $this->assertEquals($this->fakeVersion, $newNode->getVersion());

Call to method getTemplate from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $this->assertEquals($template, $newNode->getTemplate());

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertEquals
Open

        $this->assertEquals($template, $newNode->getTemplate());

Call to method verify from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($node)->getTemplate()->thenReturn('fake_template');

Call to method when from undeclared class \Phake
Open

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

Call to method getNodeType from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

            $this->assertSame(NodeInterface::TYPE_DEFAULT, $node->getNodeType());

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->node, Phake::times(4))->setParentId($parentNodeId);

Call to method mock from undeclared class \Phake
Open

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

Call to method mock from undeclared class \Phake
Open

        $this->templateManager = Phake::mock('OpenOrchestra\Backoffice\Manager\TemplateManager');

Call to method mock from undeclared class \Phake
Open

        $tokenStorage = Phake::mock('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage');

Call to method verify from undeclared class \Phake
Open

        Phake::verify($alteredNode)->setLanguage($language);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($alteredNode)->setMetaDescription(null);

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertSame
Open

            $this->assertSame(NodeInterface::TYPE_DEFAULT, $node->getNodeType());

Call to method when from undeclared class \Phake
Open

        Phake::when($parentNode0)->getNodeType()->thenReturn(NodeInterface::TYPE_DEFAULT);

Call to method when from undeclared class \Phake
Open

        Phake::when($parentNode)->getNodeId()->thenReturn($parentNodeId);

Call to method verify from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($this->status)->getLabels()->thenReturn(array());

Call to method when from undeclared class \Phake
Open

        Phake::when($this->area)->getBlocks()->thenReturn(array($this->block, $this->blockTransverse));

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($alteredNode)->setSeoTitle(null);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($alteredNode)->setMetaIndex(false);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($alteredNode)->initializeKeywords();

Call to method getNodeId from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

            $this->assertSame(NodeInterface::ROOT_NODE_ID, $node->getNodeId());

Call to method when from undeclared class \Phake
Open

        Phake::when($site)->getTemplateSet()->thenReturn('fake_template_set');

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertInstanceOf
Open

        $this->assertInstanceOf($this->nodeClass, $node);

Call to method getOrder from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $this->assertEquals(0, $node->getOrder());

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

            $this->assertSame(NodeInterface::ROOT_NODE_ID, $node->getNodeId());

Call to method getNodeId from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

            $this->assertSame(NodeInterface::ROOT_NODE_ID, $node->getNodeId());

Call to method never from undeclared class \Phake
Open

        Phake::verify($this->documentManager, Phake::never())->remove($this->blockTransverse);

Call to method anyParameters from undeclared class \Phake
Open

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

Call to method verify from undeclared class \Phake
Open

        Phake::verify($node, Phake::times(2))->setArea(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($parentNode)->getPath()->thenReturn($parentPath);

Call to method mock from undeclared class \Phake
Open

        $this->user = Phake::mock('OpenOrchestra\UserBundle\Model\UserInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($tokenStorage)->getToken()->thenReturn($token);

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertEquals
Open

        $this->assertEquals($language, $newNode->getLanguage());

Call to method getOrder from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $this->assertEquals(0, $node->getOrder());

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertSame
Open

            $this->assertSame(NodeInterface::TYPE_DEFAULT, $node->getNodeType());

Call to method getLanguage from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $this->assertEquals($language, $node->getLanguage());

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertEquals
Open

        $this->assertEquals(0, $node->getOrder());

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

        Phake::when($parentNode0)->getNodeType()->thenReturn(NodeInterface::TYPE_DEFAULT);

Call to method mock from undeclared class \Phake
Open

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

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->node, Phake::times(4))->setParentId($parentNodeId);

Call to method anyParameters from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($this->blockRepository)->getDocumentManager()->thenReturn($this->documentManager);

Call to method getVersion from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $this->assertEquals($this->fakeVersion, $newNode->getVersion());

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->blockRepository)->getDocumentManager();

Call to method when from undeclared class \Phake
Open

        Phake::when($this->nodeRepository)->findVersionNotDeleted(Phake::anyParameters())->thenReturn($parentNode);

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

            $this->assertSame(NodeInterface::ROOT_NODE_ID, $node->getNodeId());

Call to method when from undeclared class \Phake
Open

        Phake::when($this->nodeRepository)->findVersionNotDeleted(Phake::anyParameters())->thenReturn($parentNode);

Call to method when from undeclared class \Phake
Open

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

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->documentManager)->remove($this->block);

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->node, Phake::times(4))->setOrder($position);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->documentManager, Phake::never())->remove($this->blockTransverse);

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($this->node)->getTemplate()->thenReturn('fakeTemplate');

Call to method getNodeId from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $this->assertEquals($nodeId, $newNode->getNodeId());

Call to method getNodeType from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $this->assertEquals(ReadNodeInterface::TYPE_ERROR, $newNode->getNodeType());

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertEquals
Open

        $this->assertEquals(ReadNodeInterface::TYPE_ERROR, $newNode->getNodeType());

Call to method anyParameters from undeclared class \Phake
Open

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

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

            $this->assertSame(NodeInterface::TYPE_DEFAULT, $node->getNodeType());

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->templateManager)->getTemplateAreas(Phake::anyParameters())->thenReturn($areaName);

Call to method times from undeclared class \Phake
Open

        Phake::verify($node, Phake::times(2))->setArea(Phake::anyParameters());

Parameter $parentNode has undeclared type \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

    public function testCreateRootNode($language, $siteId, NodeInterface $parentNode = null)

Call to method mock from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($this->templateManager)->getTemplateAreas(Phake::anyParameters())->thenReturn($areaName);

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertEquals
Open

        $this->assertEquals($siteId, $node->getSiteId());

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertSame
Open

            $this->assertSame(NodeInterface::ROOT_NODE_ID, $node->getNodeId());

Call to method when from undeclared class \Phake
Open

        Phake::when($parentNode0)->getNodeId()->thenReturn('fakeId');

Call to method getSiteId from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $this->assertEquals($siteId, $node->getSiteId());

Call to method mock from undeclared class \Phake
Open

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

Call to method getNodeType from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

            $this->assertSame(NodeInterface::TYPE_DEFAULT, $node->getNodeType());

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($node, Phake::times(2))->setArea(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

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

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertEquals
Open

        $this->assertEquals(false, $newNode->isInMenu());

Call to method anyParameters from undeclared class \Phake
Open

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

Parameter $parentNode has undeclared type \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

    public function testInitializeNode($language, $siteId, NodeInterface $parentNode = null)

Call to method getSiteId from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $this->assertEquals($siteId, $node->getSiteId());

Call to method mock from undeclared class \Phake
Open

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

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\NodeManagerTest::assertEquals
Open

        $this->assertEquals($language, $node->getLanguage());

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

    }

There are no issues that match your filters.

Category
Status