open-orchestra/open-orchestra-cms-bundle

View on GitHub
LogBundle/Tests/EventSubscriber/LogNodeSubscriberTest.php

Summary

Maintainability
A
0 mins
Test Coverage

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

        $nodeDeleteEvent = Phake::mock('OpenOrchestra\ModelInterface\Event\NodeDeleteEvent');

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\ModelBundle\Document\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->nodeEvent = Phake::mock('OpenOrchestra\ModelInterface\Event\NodeEvent');

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

Reference to constant NODE_UPDATE_BLOCK_POSITION from undeclared class \OpenOrchestra\ModelInterface\NodeEvents
Open

            array(NodeEvents::NODE_UPDATE_BLOCK_POSITION),

Reference to constant NODE_UPDATE_BLOCK from undeclared class \OpenOrchestra\ModelInterface\NodeEvents
Open

            array(NodeEvents::NODE_UPDATE_BLOCK),

Call to method mock from undeclared class \Phake
Open

        $this->node = Phake::mock('OpenOrchestra\ModelBundle\Document\Node');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->nodeEvent)->getNode()->thenReturn($this->node);

Reference to constant NODE_CREATION from undeclared class \OpenOrchestra\ModelInterface\NodeEvents
Open

            array(NodeEvents::NODE_CREATION),

Reference to constant NODE_RESTORE from undeclared class \OpenOrchestra\ModelInterface\NodeEvents
Open

            array(NodeEvents::NODE_RESTORE),

Reference to constant NODE_UPDATE from undeclared class \OpenOrchestra\ModelInterface\NodeEvents
Open

            array(NodeEvents::NODE_UPDATE),

Reference to constant NODE_DELETE from undeclared class \OpenOrchestra\ModelInterface\NodeEvents
Open

            array(NodeEvents::NODE_DELETE),

Call to method mock from undeclared class \Phake
Open

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

Reference to constant NODE_DUPLICATE from undeclared class \OpenOrchestra\ModelInterface\NodeEvents
Open

            array(NodeEvents::NODE_DUPLICATE),

Call to method mock from undeclared class \Phake
Open

        $nodeDeleteEvent = Phake::mock('OpenOrchestra\ModelInterface\Event\NodeDeleteEvent');

Call to method when from undeclared class \Phake
Open

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

Reference to constant NODE_ADD_LANGUAGE from undeclared class \OpenOrchestra\ModelInterface\NodeEvents
Open

            array(NodeEvents::NODE_ADD_LANGUAGE),

There are no issues that match your filters.

Category
Status