open-orchestra/open-orchestra-cms-bundle

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

Summary

Maintainability
A
0 mins
Test Coverage

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

        $this->transformer = 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 '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 '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 '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

Call to method when from undeclared class \Phake
Open

        Phake::when($this->transformer)->generateTransitionName($this->status1, $this->status1)->thenReturn('1-1');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->transformer)->generateTransitionName($this->status2, $this->status1)->thenReturn('2-1');

Call to method verify from undeclared class \Phake
Open

        Phake::verify($builder)->add('transitions', 'oo_workflow_transitions_collection', array(

Call to method mock from undeclared class \Phake
Open

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

Call to method mock from undeclared class \Phake
Open

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

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

class WorkflowProfileTransitionsTypeTest extends AbstractBaseTestCase

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

    protected function generateStatus($statusId)

Call to method mock from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($this->transformer)->generateTransitionName($this->status1, $this->status2)->thenReturn('1-2');

Call to method verify from undeclared class \Phake
Open

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

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

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

Call to method when from undeclared class \Phake
Open

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

Call to method anyParameters from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($this->transformer)->generateTransitionName($this->status2, $this->status2)->thenReturn('2-2');

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

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

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

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

There are no issues that match your filters.

Category
Status