open-orchestra/open-orchestra-cms-bundle

View on GitHub
Workflow/Tests/Factory/TransitionFactoryTest.php

Summary

Maintainability
A
0 mins
Test Coverage

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

        $statusTo = 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 'testCreate'.
Open

        $statusFrom = 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

Call to undeclared method \OpenOrchestra\Workflow\Tests\Factory\TransitionFactoryTest::assertSame
Open

        $this->assertSame($statusTo, $transition->getStatusTo());

Call to method getStatusTo from undeclared class \OpenOrchestra\ModelInterface\Model\WorkflowTransitionInterface
Open

        $this->assertSame($statusTo, $transition->getStatusTo());

Call to undeclared method \OpenOrchestra\Workflow\Tests\Factory\TransitionFactoryTest::assertInstanceOf
Open

        $this->assertInstanceOf($this->transitionClassName, $transition);

Call to undeclared method \OpenOrchestra\Workflow\Tests\Factory\TransitionFactoryTest::assertSame
Open

        $this->assertSame($statusFrom, $transition->getStatusFrom());

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

class TransitionFactoryTest extends AbstractBaseTestCase

Call to method mock from undeclared class \Phake
Open

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

Call to method mock from undeclared class \Phake
Open

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

Call to method getStatusFrom from undeclared class \OpenOrchestra\ModelInterface\Model\WorkflowTransitionInterface
Open

        $this->assertSame($statusFrom, $transition->getStatusFrom());

There are no issues that match your filters.

Category
Status