open-orchestra/open-orchestra-cms-bundle

View on GitHub
Backoffice/Tests/Form/Type/Component/FieldChoiceTypeTest.php

Summary

Maintainability
A
0 mins
Test Coverage

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

            Phake::verify($this->builder)->addEventListener(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

        $this->builder = Phake::mock('Symfony\Component\Form\FormBuilder');

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 verify from undeclared class \Phake
Open

            Phake::verify($this->builder)->addEventListener(Phake::anyParameters());

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Form\Type\Component\FieldChoiceTypeTest::assertEquals
Open

        $this->assertEquals('oo_field_choice', $this->form->getName());

Call to method mock from undeclared class \Phake
Open

        $this->builder = Phake::mock('Symfony\Component\Form\FormBuilder');

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Form\Type\Component\FieldChoiceTypeTest::assertEquals
Open

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

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

class FieldChoiceTypeTest extends AbstractBaseTestCase

Call to method anyParameters from undeclared class \Phake
Open

            Phake::verify($this->builder)->addEventListener(Phake::anyParameters());

There are no issues that match your filters.

Category
Status