open-orchestra/open-orchestra-cms-bundle

View on GitHub
Backoffice/Tests/EventSubscriber/CreateMandatoryNodesSubscriberTest.php

Summary

Maintainability
A
0 mins
Test Coverage

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

        $this->siteEvent = Phake::mock('OpenOrchestra\ModelInterface\Event\SiteEvent');

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->nodeManager)->createNewErrorNode(Phake::anyParameters())->thenReturn(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 'testCreateMandatoryNodes'.
Open

        Phake::verify($this->nodeManager, Phake::times($count))->createRootNode(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 'testCreateMandatoryNodes'.
Open

        Phake::verify($this->nodeManager, Phake::times($count * 2 ))->createNewErrorNode(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->nodeManager)->createRootNode(Phake::anyParameters())->thenReturn(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->nodeManager)->initializeAreasNode(Phake::anyParameters())->thenReturn(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->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->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 'testCreateMandatoryNodes'.
Open

        Phake::verify($this->nodeManager, Phake::times($count))->createRootNode(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->nodeManager)->createRootNode(Phake::anyParameters())->thenReturn(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->objectManager = 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 'setUp'.
Open

        Phake::when($this->nodeManager)->initializeAreasNode(Phake::anyParameters())->thenReturn(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 'testCreateMandatoryNodes'.
Open

        Phake::verify($this->objectManager, Phake::times($count * 3))->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

        Phake::when($this->statusRepository)->findOneByTranslationState()->thenReturn(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->nodeManager = Phake::mock('OpenOrchestra\Backoffice\Manager\NodeManager');

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->translator = Phake::mock('Symfony\Component\Translation\TranslatorInterface');

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

        Phake::verify($this->nodeManager, Phake::times($count * 2 ))->createNewErrorNode(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 'testCreateMandatoryNodes'.
Open

        Phake::verify($this->objectManager, Phake::times($count * 3))->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

        Phake::when($this->nodeManager)->createNewErrorNode(Phake::anyParameters())->thenReturn(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

Call to method mock from undeclared class \Phake
Open

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

Call to method mock from undeclared class \Phake
Open

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

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->nodeManager, Phake::times($count))->createRootNode(Phake::anyParameters());

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->nodeManager)->createNewErrorNode(Phake::anyParameters())->thenReturn(Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface'));

Call to method mock from undeclared class \Phake
Open

        $this->siteEvent = Phake::mock('OpenOrchestra\ModelInterface\Event\SiteEvent');

Call to method mock from undeclared class \Phake
Open

        Phake::when($this->nodeManager)->initializeAreasNode(Phake::anyParameters())->thenReturn(Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface'));

Call to method when from undeclared class \Phake
Open

        Phake::when($this->siteEvent)->getSite()->thenReturn($this->site);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->nodeManager)->initializeAreasNode(Phake::anyParameters())->thenReturn(Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface'));

Call to method when from undeclared class \Phake
Open

        Phake::when($this->site)->getLanguages()->thenReturn($languages);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->objectManager, Phake::times($count * 3))->persist(Phake::anyParameters());

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->objectManager, Phake::times($count * 3))->persist(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

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

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->nodeManager)->createRootNode(Phake::anyParameters())->thenReturn(Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface'));

Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\CreateMandatoryNodesSubscriberTest::assertArrayHasKey
Open

        $this->assertArrayHasKey(SiteEvents::SITE_CREATE, $this->subscriber->getSubscribedEvents());

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->objectManager, Phake::times($count * 3))->persist(Phake::anyParameters());

Reference to constant SITE_CREATE from undeclared class \OpenOrchestra\ModelInterface\SiteEvents
Open

        $this->assertArrayHasKey(SiteEvents::SITE_CREATE, $this->subscriber->getSubscribedEvents());

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->nodeManager, Phake::times($count))->createRootNode(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

        $this->translator = Phake::mock('Symfony\Component\Translation\TranslatorInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->statusRepository)->findOneByTranslationState()->thenReturn(Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface'));

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->objectManager)->flush();

Call to method when from undeclared class \Phake
Open

        Phake::when($this->nodeManager)->createNewErrorNode(Phake::anyParameters())->thenReturn(Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface'));

Call to method mock from undeclared class \Phake
Open

        Phake::when($this->nodeManager)->createRootNode(Phake::anyParameters())->thenReturn(Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface'));

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->nodeManager, Phake::times($count * 2 ))->createNewErrorNode(Phake::anyParameters());

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->nodeManager, Phake::times($count))->createRootNode(Phake::anyParameters());

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->nodeManager, Phake::times($count * 2 ))->createNewErrorNode(Phake::anyParameters());

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->nodeManager)->initializeAreasNode(Phake::anyParameters())->thenReturn(Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface'));

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->nodeManager, Phake::times($count * 2 ))->createNewErrorNode(Phake::anyParameters());

Class extends undeclared class \PHPUnit_Framework_TestCase
Open

class CreateMandatoryNodesSubscriberTest extends \PHPUnit_Framework_TestCase

Call to method mock from undeclared class \Phake
Open

        Phake::when($this->nodeManager)->createNewErrorNode(Phake::anyParameters())->thenReturn(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 mock from undeclared class \Phake
Open

        Phake::when($this->statusRepository)->findOneByTranslationState()->thenReturn(Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface'));

Call to method when from undeclared class \Phake
Open

        Phake::when($this->nodeManager)->createRootNode(Phake::anyParameters())->thenReturn(Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface'));

Line exceeds 120 characters; contains 153 characters
Open

        Phake::when($this->statusRepository)->findOneByTranslationState()->thenReturn(Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface'));

Line exceeds 120 characters; contains 162 characters
Open

        Phake::when($this->nodeManager)->initializeAreasNode(Phake::anyParameters())->thenReturn(Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface'));

Line exceeds 120 characters; contains 161 characters
Open

        Phake::when($this->nodeManager)->createNewErrorNode(Phake::anyParameters())->thenReturn(Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface'));

Line exceeds 120 characters; contains 157 characters
Open

        Phake::when($this->nodeManager)->createRootNode(Phake::anyParameters())->thenReturn(Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface'));

Expected 0 spaces before closing bracket; 1 found
Open

        Phake::verify($this->nodeManager, Phake::times($count * 2 ))->createNewErrorNode(Phake::anyParameters());

There are no issues that match your filters.

Category
Status