open-orchestra/open-orchestra-cms-bundle

View on GitHub
Backoffice/Tests/Form/DataTransformer/BBcodeToHtmlTransformerTest.php

Summary

Maintainability
A
0 mins
Test Coverage

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

        $this->parser = Phake::mock('OpenOrchestra\BBcodeBundle\Parser\BBcodeParser');

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 unused local variables such as '$html'.
Open

        $html = $this->transformer->transform($this->html);

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->parser)->parse($this->html);

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Form\DataTransformer\BBcodeToHtmlTransformerTest::assertSame
Open

        $this->assertSame($this->html, $bbcode);

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

class BBcodeToHtmlTransformerTest extends AbstractBaseTestCase

Call to method mock from undeclared class \Phake
Open

        $this->parser = Phake::mock('OpenOrchestra\BBcodeBundle\Parser\BBcodeParser');

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->parser)->getAsPreviewHTML();

There are no issues that match your filters.

Category
Status