open-orchestra/open-orchestra-cms-bundle

View on GitHub
Workflow/Tests/Form/Type/Component/WorkflowTransitionsCollectionTypeTest.php

Summary

Maintainability
A
0 mins
Test Coverage

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

        $view = Phake::mock('Symfony\Component\Form\FormView');

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

        Phake::when($status)->getLabel(Phake::anyParameters())->thenReturn('label-' . $statusId);

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->transitionTransformer = Phake::mock('OpenOrchestra\Workflow\Form\DataTransformer\ProfileTransitionsTransformer');

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

        $status = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');

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

        $builder = Phake::mock('Symfony\Component\Form\FormBuilderInterface');

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

        $resolver = Phake::mock('Symfony\Component\OptionsResolver\OptionsResolver');

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

        $form = Phake::mock('Symfony\Component\Form\FormInterface');

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

        $view = Phake::mock('Symfony\Component\Form\FormView');

Call to method mock from undeclared class \Phake
Open

        $form = Phake::mock('Symfony\Component\Form\FormInterface');

Call to method mock from undeclared class \Phake
Open

        $status = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');

Call to undeclared method \OpenOrchestra\Workflow\Tests\Form\Type\Component\WorkflowTransitionsCollectionTypeTest::assertSame
Open

        $this->assertSame($expected, $view->vars['statuses']);

Call to method when from undeclared class \Phake
Open

        Phake::when($status)->getId()->thenReturn($statusId);

Call to method when from undeclared class \Phake
Open

        Phake::when($status)->getLabel(Phake::anyParameters())->thenReturn('label-' . $statusId);

Call to method mock from undeclared class \Phake
Open

        $this->transitionTransformer = Phake::mock('OpenOrchestra\Workflow\Form\DataTransformer\ProfileTransitionsTransformer');

Call to undeclared method \OpenOrchestra\Workflow\Tests\Form\Type\Component\WorkflowTransitionsCollectionTypeTest::assertSame
Open

        $this->assertSame('choice', $this->form->getParent());

Call to undeclared method \OpenOrchestra\Workflow\Tests\Form\Type\Component\WorkflowTransitionsCollectionTypeTest::assertSame
Open

        $this->assertSame('oo_workflow_transitions_collection', $this->form->getName());

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($status)->getLabel(Phake::anyParameters())->thenReturn('label-' . $statusId);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($builder)->addModelTransformer($this->transitionTransformer);

Call to method mock from undeclared class \Phake
Open

        $builder = Phake::mock('Symfony\Component\Form\FormBuilderInterface');

Call to undeclared method \OpenOrchestra\Workflow\Tests\Form\Type\Component\WorkflowTransitionsCollectionTypeTest::assertInstanceOf
Open

        $this->assertInstanceOf('Symfony\Component\Form\AbstractType', $this->form);

Call to method mock from undeclared class \Phake
Open

        $resolver = Phake::mock('Symfony\Component\OptionsResolver\OptionsResolver');

Return type of generateStatus() is undeclared type \OpenOrchestra\Workflow\Tests\Form\Type\Component\Phake_IMock
Open

    protected function generateStatus($statusId)

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

class WorkflowTransitionsCollectionTypeTest extends AbstractBaseTestCase

Call to method verify from undeclared class \Phake
Open

        Phake::verify($resolver)->setDefaults(array(

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

    protected $transitionTransformer;

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 128 characters
Open

        $this->transitionTransformer = Phake::mock('OpenOrchestra\Workflow\Form\DataTransformer\ProfileTransitionsTransformer');

There are no issues that match your filters.

Category
Status