open-orchestra/open-orchestra-cms-bundle

View on GitHub
WorkflowAdminBundle/Tests/Tranformer/WorkflowProfileTransformerTest.php

Summary

Maintainability
A
0 mins
Test Coverage

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

        $this->workflowProfileRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\WorkflowProfileRepositoryInterface');

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

        Phake::verify($this->workflowProfileRepository)->find(Phake::anyParameters());

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

        $transformerManager = 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

        $this->workflowProfile = Phake::mock('OpenOrchestra\ModelInterface\Model\WorkflowProfileInterface');

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

        Phake::when($this->multiLanguagesChoiceManager)->choose(Phake::anyParameters())->thenReturn($fakeString);

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->transformer->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

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

        Phake::when($this->workflowProfileRepository)->find(Phake::anyParameters())->thenReturn($this->workflowProfile);

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($authorizationChecker)->isGranted(Phake::anyParameters())->thenReturn(true);

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(true);

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

        $facade = Phake::mock('OpenOrchestra\BaseApi\Facade\FacadeInterface');

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

        $authorizationChecker = Phake::mock('Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface');

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->multiLanguagesChoiceManager = Phake::mock('OpenOrchestra\ModelInterface\Manager\MultiLanguagesChoiceManagerInterface');

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->workflowProfile)->getTransitions()->thenReturn(array());

Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Tests\Transformer\WorkflowProfileTransformerTest::assertSame
Open

        $this->assertSame($fakeString, $facade->label);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->multiLanguagesChoiceManager)->choose(Phake::anyParameters())->thenReturn($fakeString);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->workflowProfile)->getDescriptions()->thenReturn(array());

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

        $this->assertSame($fakeString, $facade->label);

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

        $this->assertSame($fakeString, $facade->description);

Call to method mock from undeclared class \Phake
Open

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

Call to method mock from undeclared class \Phake
Open

        $facade = Phake::mock('OpenOrchestra\BaseApi\Facade\FacadeInterface');

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->workflowProfileRepository)->find(Phake::anyParameters());

Call to method when from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($authorizationChecker)->isGranted(Phake::anyParameters())->thenReturn(true);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->workflowProfileRepository)->find(Phake::anyParameters());

Call to method when from undeclared class \Phake
Open

        Phake::when($this->workflowProfile)->getId()->thenReturn($this->workflowProfileId);

Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Tests\Transformer\WorkflowProfileTransformerTest::assertInstanceOf
Open

        $this->assertInstanceOf('OpenOrchestra\BaseApi\Facade\FacadeInterface', $facade);

Call to method mock from undeclared class \Phake
Open

        $this->multiLanguagesChoiceManager = Phake::mock('OpenOrchestra\ModelInterface\Manager\MultiLanguagesChoiceManagerInterface');

Call to method mock from undeclared class \Phake
Open

        $this->workflowProfile = Phake::mock('OpenOrchestra\ModelInterface\Model\WorkflowProfileInterface');

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

class WorkflowProfileTransformerTest extends AbstractBaseTestCase

Call to method anyParameters from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($this->workflowProfile)->getLabels()->thenReturn(array());

Call to method mock from undeclared class \Phake
Open

        $this->workflowProfileRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\WorkflowProfileRepositoryInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->workflowProfileRepository)->find(Phake::anyParameters())->thenReturn($this->workflowProfile);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->multiLanguagesChoiceManager)->choose(Phake::anyParameters())->thenReturn($fakeString);

Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Tests\Transformer\WorkflowProfileTransformerTest::assertSame
Open

        $this->assertSame('workflow_profile', $this->transformer->getName());

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($authorizationChecker)->isGranted(Phake::anyParameters())->thenReturn(true);

Call to method mock from undeclared class \Phake
Open

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

Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Transformer\WorkflowProfileTransformer::setContext
Open

        $this->transformer->setContext($transformerManager);

Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Tests\Transformer\WorkflowProfileTransformerTest::assertSame
Open

        $this->assertSame($this->workflowProfileId, $facade->id);

Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Tests\Transformer\WorkflowProfileTransformerTest::assertSame
Open

        $this->assertSame($fakeString, $facade->description);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->workflowProfileRepository)->find(Phake::anyParameters())->thenReturn($this->workflowProfile);

Call to method mock from undeclared class \Phake
Open

        $authorizationChecker = Phake::mock('Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface');

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

        $this->assertSame($this->workflowProfileId, $facade->id);

Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Tests\Transformer\WorkflowProfileTransformerTest::expectException
Open

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

Call to method mock from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

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

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

    protected $multiLanguagesChoiceManager;

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

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

    protected $workflowProfileRepository;

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

Line exceeds 120 characters; contains 134 characters
Open

        $this->multiLanguagesChoiceManager = Phake::mock('OpenOrchestra\ModelInterface\Manager\MultiLanguagesChoiceManagerInterface');

Line exceeds 120 characters; contains 133 characters
Open

        $this->workflowProfileRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\WorkflowProfileRepositoryInterface');

Line exceeds 120 characters; contains 123 characters
Open

        $authorizationChecker = Phake::mock('Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface');

There are no issues that match your filters.

Category
Status