open-orchestra/open-orchestra-cms-bundle

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

Summary

Maintainability
A
0 mins
Test Coverage

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

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

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

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 undeclared method \OpenOrchestra\Backoffice\Tests\Form\Type\Component\CheckListTypeTest::assertEquals
Open

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

Call to method mock from undeclared class \Phake
Open

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

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->builder)->add('check_list', 'collection', array(

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

class CheckListTypeTest extends AbstractBaseTestCase

Call to method verify from undeclared class \Phake
Open

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

Call to method mock from undeclared class \Phake
Open

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

There are no issues that match your filters.

Category
Status