open-orchestra/open-orchestra-cms-bundle

View on GitHub
ApiBundle/Tests/Transformer/BlockTransformerTest.php

Summary

Maintainability
A
0 mins
Test Coverage

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

        $this->displayBlockManager = Phake::mock('OpenOrchestra\Backoffice\DisplayBlock\DisplayBlockManager');

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

        $nodeRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\NodeRepositoryInterface');

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

        $context = Phake::mock('OpenOrchestra\BaseApi\Transformer\TransformerManager');

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

        Phake::when($generateFormManager)->getRequiredUriParameter(Phake::anyParameters())->thenReturn(array());

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->translator = Phake::mock('Symfony\Component\Translation\TranslatorInterface');

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

        $block = Phake::mock('OpenOrchestra\ModelInterface\Model\BlockInterface');

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

        $groupContext = Phake::mock('OpenOrchestra\BaseApi\Context\GroupContext');

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->blockConfigurationManager = Phake::mock('OpenOrchestra\Backoffice\Manager\BlockConfigurationManager');

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

        Phake::when($groupContext)->hasGroup(Phake::anyParameters())->thenReturn(false);

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

        $generateFormManager = Phake::mock('OpenOrchestra\BackofficeBundle\StrategyManager\GenerateFormManager');

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

        $blockRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\BlockRepositoryInterface');

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

        $this->blockTransformer->transform(Phake::mock('stdClass'));

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->blockConfigurationManager = Phake::mock('OpenOrchestra\Backoffice\Manager\BlockConfigurationManager');

Call to method when from undeclared class \Phake
Open

        Phake::when($context)->getGroupContext()->thenReturn($groupContext);

Call to method when from undeclared class \Phake
Open

        Phake::when($generateFormManager)->getRequiredUriParameter(Phake::anyParameters())->thenReturn(array());

Call to method when from undeclared class \Phake
Open

        Phake::when($block)->getLabel()->thenReturn($label);

Call to undeclared method \OpenOrchestra\ApiBundle\Tests\Transformer\BlockTransformerTest::assertInstanceOf
Open

        $this->assertInstanceOf('OpenOrchestra\ApiBundle\Facade\BlockFacade', $facadeResult);

Call to method getAttributes from undeclared class \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open

        $this->assertSame($expectedAttributes, $facadeResult->getAttributes());

Call to undeclared method \OpenOrchestra\ApiBundle\Tests\Transformer\BlockTransformerTest::assertSame
Open

        $this->assertSame($component, $facadeResult->component);

Call to method mock from undeclared class \Phake
Open

        $this->blockTransformer->transform(Phake::mock('stdClass'));

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($groupContext)->hasGroup(Phake::anyParameters())->thenReturn(false);

Call to method mock from undeclared class \Phake
Open

        $generateFormManager = Phake::mock('OpenOrchestra\BackofficeBundle\StrategyManager\GenerateFormManager');

Call to undeclared method \OpenOrchestra\ApiBundle\Tests\Transformer\BlockTransformerTest::assertSame
Open

        $this->assertSame('block', $name);

Call to undeclared method \OpenOrchestra\ApiBundle\Tests\Transformer\BlockTransformerTest::assertSame
Open

        $this->assertSame($expectedAttributes, $facadeResult->getAttributes());

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

class BlockTransformerTest extends AbstractBaseTestCase

Call to method mock from undeclared class \Phake
Open

        $nodeRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\NodeRepositoryInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($block)->getAttributes()->thenReturn($attributes);

Call to method mock from undeclared class \Phake
Open

        $context = Phake::mock('OpenOrchestra\BaseApi\Transformer\TransformerManager');

Call to method mock from undeclared class \Phake
Open

        $block = Phake::mock('OpenOrchestra\ModelInterface\Model\BlockInterface');

Reference to instance property component from undeclared class \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open

        $this->assertSame($component, $facadeResult->component);

Call to undeclared method \OpenOrchestra\ApiBundle\Tests\Transformer\BlockTransformerTest::expectException
Open

        $this->expectException('OpenOrchestra\BaseApi\Exceptions\TransformerParameterTypeException');

Call to method when from undeclared class \Phake
Open

        Phake::when($block)->getComponent()->thenReturn($component);

Call to method when from undeclared class \Phake
Open

        Phake::when($groupContext)->hasGroup(Phake::anyParameters())->thenReturn(false);

Call to method mock from undeclared class \Phake
Open

        $this->translator = Phake::mock('Symfony\Component\Translation\TranslatorInterface');

Call to method mock from undeclared class \Phake
Open

        $blockRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\BlockRepositoryInterface');

Call to method mock from undeclared class \Phake
Open

        $groupContext = Phake::mock('OpenOrchestra\BaseApi\Context\GroupContext');

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($generateFormManager)->getRequiredUriParameter(Phake::anyParameters())->thenReturn(array());

Call to method mock from undeclared class \Phake
Open

        $this->displayBlockManager = Phake::mock('OpenOrchestra\Backoffice\DisplayBlock\DisplayBlockManager');

Call to undeclared method \OpenOrchestra\ApiBundle\Transformer\BlockTransformer::setContext
Open

        $this->blockTransformer->setContext($context);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->displayBlockManager)->show($block)->thenReturn($html);

Avoid excessively long variable names like $blockConfigurationManager. Keep variable name length under 20.
Open

    protected $blockConfigurationManager;

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line
Open

    {

There are no issues that match your filters.

Category
Status