open-orchestra/open-orchestra-cms-bundle

View on GitHub
WorkflowAdminBundle/Tests/DataTransformer/GroupWorkflowProfileCollectionTransformerTest.php

Summary

Maintainability
A
0 mins
Test Coverage

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

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

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

        $workflowProfileRepository = Phake::mock('OpenOrchestra\ModelBundle\Repository\WorkflowProfileRepository');

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

        $contenType = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentTypeInterface');

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

        $workflowProfileCollection = Phake::mock('OpenOrchestra\ModelBundle\Document\WorkflowProfileCollection');

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

        $contentTypeRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\ContentTypeRepositoryInterface');

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

        $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 'setUp'.
Open

        Phake::when($contenType)->getName(Phake::anyParameters())->thenReturn('fakeName');

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

        $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

Call to method mock from undeclared class \Phake
Open

        $contextManager = Phake::mock('OpenOrchestra\Backoffice\Context\ContextBackOfficeInterface');

Call to method mock from undeclared class \Phake
Open

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

Call to method mock from undeclared class \Phake
Open

        $workflowProfileCollection = Phake::mock('OpenOrchestra\ModelBundle\Document\WorkflowProfileCollection');

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Form\DataTransformer\GroupWorkflowProfileCollectionTransformerTest::assertArrayHasKey
Open

        $this->assertArrayHasKey('fakeContentTypeId', $result);

Call to method mock from undeclared class \Phake
Open

        $contenType = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentTypeInterface');

Reference to undeclared property \OpenOrchestra\Backoffice\Tests\Form\DataTransformer\GroupWorkflowProfileCollectionTransformerTest->transformer
Open

        $this->transformer = new GroupWorkflowProfileCollectionTransformer(

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Form\DataTransformer\GroupWorkflowProfileCollectionTransformerTest::assertEquals
Open

        $this->assertEquals(array('node' => array('fakeId' => true), 'fakeContentTypeId' => array('fakeId' => false)), $result);

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

class GroupWorkflowProfileCollectionTransformerTest extends AbstractBaseTestCase

Call to method mock from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($contenType)->getName(Phake::anyParameters())->thenReturn('fakeName');

Call to method when from undeclared class \Phake
Open

        Phake::when($contenType)->getContentTypeId()->thenReturn('fakeContentTypeId');

Reference to undeclared property \OpenOrchestra\Backoffice\Tests\Form\DataTransformer\GroupWorkflowProfileCollectionTransformerTest->transformer
Open

        $result = $this->transformer->reverseTransform($value);

Call to method when from undeclared class \Phake
Open

        Phake::when($workflowProfile)->getLabel()->thenReturn('fakeWorkflowProfileLabel');

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Form\DataTransformer\GroupWorkflowProfileCollectionTransformerTest::assertInstanceOf
Open

        $this->assertInstanceOf('Symfony\Component\Form\DataTransformerInterface', $this->transformer);

Call to method set from undeclared class \Doctrine\Common\Collections\ArrayCollection
Open

        $value->set('node', $workflowProfileCollection);

Call to method mock from undeclared class \Phake
Open

        $workflowProfileRepository = Phake::mock('OpenOrchestra\ModelBundle\Repository\WorkflowProfileRepository');

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($contenType)->getName(Phake::anyParameters())->thenReturn('fakeName');

Reference to undeclared property \OpenOrchestra\Backoffice\Tests\Form\DataTransformer\GroupWorkflowProfileCollectionTransformerTest->transformer
Open

        $this->assertInstanceOf('Symfony\Component\Form\DataTransformerInterface', $this->transformer);

Call to method when from undeclared class \Phake
Open

        Phake::when($workflowProfile)->getId()->thenReturn('fakeId');

Call to method mock from undeclared class \Phake
Open

        $contentTypeRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\ContentTypeRepositoryInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($workflowProfileRepository)->findAll()->thenReturn(array($workflowProfile));

Call to method when from undeclared class \Phake
Open

        Phake::when($workflowProfileCollection)->getProfiles()->thenReturn(array($workflowProfile));

Call to method when from undeclared class \Phake
Open

        Phake::when($workflowProfile)->getId()->thenReturn('fakeId');

Reference to undeclared property \OpenOrchestra\Backoffice\Tests\Form\DataTransformer\GroupWorkflowProfileCollectionTransformerTest->transformer
Open

        $result = $this->transformer->transform($value);

Call to method when from undeclared class \Phake
Open

        Phake::when($contentTypeRepository)->findAllNotDeletedInLastVersion()->thenReturn(array($contenType));

Call to method __construct from undeclared class \Doctrine\Common\Collections\ArrayCollection
Open

        $value = new ArrayCollection();

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Form\DataTransformer\GroupWorkflowProfileCollectionTransformerTest::assertArrayHasKey
Open

        $this->assertArrayHasKey('node', $result);

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

        $workflowProfileCollection = Phake::mock('OpenOrchestra\ModelBundle\Document\WorkflowProfileCollection');

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 $contentTypeRepository. Keep variable name length under 20.
Open

        $contentTypeRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\ContentTypeRepositoryInterface');

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

        $workflowProfileRepository = Phake::mock('OpenOrchestra\ModelBundle\Repository\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

Avoid excessively long class names like GroupWorkflowProfileCollectionTransformerTest. Keep class name length under 40.
Open

class GroupWorkflowProfileCollectionTransformerTest extends AbstractBaseTestCase
{
    /**
     * Set up the test
     */

LongClassName

Since: 2.9

Detects when classes or interfaces are declared with excessively long names.

Example

class ATooLongClassNameThatHintsAtADesignProblem {

}

interface ATooLongInterfaceNameThatHintsAtADesignProblem {

}

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

Line exceeds 120 characters; contains 128 characters
Open

        $this->assertEquals(array('node' => array('fakeId' => true), 'fakeContentTypeId' => array('fakeId' => false)), $result);

There are no issues that match your filters.

Category
Status