open-orchestra/open-orchestra-cms-bundle

View on GitHub
BackofficeBundle/Tests/DependencyInjection/Compiler/FieldToElasticaTypeCompilerPassTest.php

Summary

Maintainability
A
0 mins
Test Coverage

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

        $definition = Phake::mock(Definition::CLASS);

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->containerBuilder = Phake::mock(ContainerBuilder::CLASS);

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

        Phake::when($this->containerBuilder)->getDefinition(Phake::anyParameters())->thenReturn($definition);

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

        Phake::when($this->containerBuilder)->has(Phake::anyParameters())->thenReturn(true);

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->containerBuilder)->getDefinition(Phake::anyParameters())->thenReturn($definition);

Reference to constant class from undeclared class \Symfony\Component\DependencyInjection\Definition
Open

        $definition = Phake::mock(Definition::CLASS);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->containerBuilder)->has(Phake::anyParameters())->thenReturn(true);

Reference to constant class from undeclared class \Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface
Open

        $this->assertInstanceOf(CompilerPassInterface::CLASS, $this->compiler);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->containerBuilder)->getDefinition(Phake::anyParameters())->thenReturn($definition);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->containerBuilder)->has('open_orchestra_elastica_admin.mapper.form');

Call to method mock from undeclared class \Phake
Open

        $this->containerBuilder = Phake::mock(ContainerBuilder::CLASS);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($definition)->addMethodCall('addMappingConfiguration', array('embedded_content', 'object'));

Call to undeclared method \OpenOrchestra\BackofficeBundle\Tests\DependencyInjection\Compiler\FieldToElasticaTypeCompilerPassTest::assertInstanceOf
Open

        $this->assertInstanceOf(CompilerPassInterface::CLASS, $this->compiler);

Call to method mock from undeclared class \Phake
Open

        $definition = Phake::mock(Definition::CLASS);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($definition)->addMethodCall('addMappingConfiguration', array('date', 'date'));

Call to method verify from undeclared class \Phake
Open

        Phake::verify($definition)->addMethodCall('addMappingConfiguration', array('integer', 'double'));

Reference to constant class from undeclared class \Symfony\Component\DependencyInjection\ContainerBuilder
Open

        $this->containerBuilder = Phake::mock(ContainerBuilder::CLASS);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->containerBuilder)->has(Phake::anyParameters())->thenReturn(true);

Class extends undeclared class \PHPUnit_Framework_TestCase
Open

class FieldToElasticaTypeCompilerPassTest extends \PHPUnit_Framework_TestCase

There are no issues that match your filters.

Category
Status