open-orchestra/open-orchestra-cms-bundle

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

Summary

Maintainability
A
0 mins
Test Coverage

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

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

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

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

Call to method when from undeclared class \Phake
Open

        Phake::when($this->context)->getBackOfficeLanguage()->thenReturn($this->locale);

Reference to constant CONTENT_TYPE_CREATE from undeclared class \OpenOrchestra\ModelInterface\ContentTypeEvents
Open

            array(ContentTypeEvents::CONTENT_TYPE_CREATE),

Call to method mock from undeclared class \Phake
Open

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

Reference to constant CONTENT_TYPE_UPDATE from undeclared class \OpenOrchestra\ModelInterface\ContentTypeEvents
Open

            array(ContentTypeEvents::CONTENT_TYPE_UPDATE),

Call to method mock from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($this->contentTypeEvent)->getContentType()->thenReturn($this->contentType);

Call to method mock from undeclared class \Phake
Open

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

Reference to constant CONTENT_TYPE_DELETE from undeclared class \OpenOrchestra\ModelInterface\ContentTypeEvents
Open

            array(ContentTypeEvents::CONTENT_TYPE_DELETE),

There are no issues that match your filters.

Category
Status