open-orchestra/open-orchestra-cms-bundle

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

Summary

Maintainability
A
0 mins
Test Coverage

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

        $this->logger = Phake::mock('Symfony\Bridge\Monolog\Logger');

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 verify from undeclared class \Phake
Open

        Phake::verify($this->logger)->info($message, $context);

Call to undeclared method \OpenOrchestra\LogBundle\Tests\EventSubscriber\LogAbstractSubscriberTest::assertInstanceOf
Open

        $this->assertInstanceOf('Symfony\Component\EventDispatcher\EventSubscriberInterface', $this->subscriber);

Call to undeclared method \OpenOrchestra\LogBundle\Tests\EventSubscriber\LogAbstractSubscriberTest::assertArrayHasKey
Open

        $this->assertArrayHasKey($eventName, $this->subscriber->getSubscribedEvents());

Call to method mock from undeclared class \Phake
Open

        $this->logger = Phake::mock('Symfony\Bridge\Monolog\Logger');

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

abstract class LogAbstractSubscriberTest extends AbstractBaseTestCase

There are no issues that match your filters.

Category
Status