open-orchestra/open-orchestra-cms-bundle

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

Summary

Maintainability
A
0 mins
Test Coverage

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

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

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

        $contentDeleteEvent = Phake::mock('OpenOrchestra\ModelInterface\Event\ContentDeleteEvent');

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->content = Phake::mock('OpenOrchestra\ModelBundle\Document\Content');

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->content = Phake::mock('OpenOrchestra\ModelBundle\Document\Content');

Reference to constant CONTENT_UPDATE from undeclared class \OpenOrchestra\ModelInterface\ContentEvents
Open

            array(ContentEvents::CONTENT_UPDATE),

Call to method when from undeclared class \Phake
Open

        Phake::when($this->contentEvent)->getContent()->thenReturn($this->content);

Call to method mock from undeclared class \Phake
Open

        $contentDeleteEvent = Phake::mock('OpenOrchestra\ModelInterface\Event\ContentDeleteEvent');

Call to method when from undeclared class \Phake
Open

        Phake::when($contentDeleteEvent)->getContentId()->thenReturn($this->content->getContentId());

Reference to constant CONTENT_DELETE from undeclared class \OpenOrchestra\ModelInterface\ContentEvents
Open

            array(ContentEvents::CONTENT_DELETE),

Call to method mock from undeclared class \Phake
Open

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

Reference to constant CONTENT_CREATION from undeclared class \OpenOrchestra\ModelInterface\ContentEvents
Open

            array(ContentEvents::CONTENT_CREATION),

Reference to constant CONTENT_DUPLICATE from undeclared class \OpenOrchestra\ModelInterface\ContentEvents
Open

            array(ContentEvents::CONTENT_DUPLICATE),

Reference to constant CONTENT_RESTORE from undeclared class \OpenOrchestra\ModelInterface\ContentEvents
Open

            array(ContentEvents::CONTENT_RESTORE),

There are no issues that match your filters.

Category
Status