open-orchestra/open-orchestra-cms-bundle

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

Summary

Maintainability
A
0 mins
Test Coverage

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

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

        $this->context = 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

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

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

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

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

Call to method mock from undeclared class \Phake
Open

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

Call to method verify from undeclared class \Phake
Open

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

Call to method mock from undeclared class \Phake
Open

        $this->context = Phake::mock('OpenOrchestra\Backoffice\Context\ContextBackOfficeInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->contentType2)->getName($this->locale)->thenReturn($this->contentTypeName2);

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

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

Call to method when from undeclared class \Phake
Open

        Phake::when($this->context)->getBackOfficeLanguage()->thenReturn($this->locale);

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

        $this->contentType1 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentTypeInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->contentType1)->getName($this->locale)->thenReturn($this->contentTypeName1);

Call to method mock from undeclared class \Phake
Open

        $this->contentType2 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentTypeInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->contentTypeRepository)->findAllNotDeletedInLastVersion()->thenReturn(

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Form\Type\Component\ContentTypeChoiceTypeTest::assertInstanceOf
Open

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

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

class ContentTypeChoiceTypeTest extends AbstractBaseTestCase

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

    protected $contentTypeRepository;

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

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

There are no issues that match your filters.

Category
Status