open-orchestra/open-orchestra-cms-bundle

View on GitHub
WorkflowAdminBundle/Tests/EventSubscriber/StatusableChoiceStatusSubscriberTest.php

Summary

Maintainability
A
0 mins
Test Coverage

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

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

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->objectManager = Phake::mock('Doctrine\Common\Persistence\ObjectManager');

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

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

        $this->object = Phake::mock('OpenOrchestra\ModelBundle\Document\Node');

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

        Phake::when($this->authorizationChecker)->isGranted(Phake::anyParameters())->thenReturn($isGranted);

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->authorizationChecker = Phake::mock('Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface');

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

        Phake::verify($this->form, Phake::never())->add(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 'testPreSetData'.
Open

        Phake::verify($this->form, Phake::times(1))->add(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 'testPreSetData'.
Open

        Phake::verify($this->form, Phake::times(1))->add(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 'provideStatus'.
Open

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

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

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

        Phake::verify($this->form, Phake::never())->add(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->form = Phake::mock('Symfony\Component\Form\FormInterface');

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->event)->getData()->thenReturn($this->object);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->form, Phake::times(1))->add(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

        $this->objectManager = Phake::mock('Doctrine\Common\Persistence\ObjectManager');

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->authorizationChecker)->isGranted(Phake::anyParameters())->thenReturn($isGranted);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->statusRepository)->findAll()->thenReturn($expectedStatus);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->form, Phake::times(1))->add(Phake::anyParameters());

Call to method when from undeclared class \Phake
Open

        Phake::when($status)->getId()->thenReturn('status');

Call to method when from undeclared class \Phake
Open

        Phake::when($status2)->getId()->thenReturn('status2');

Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\StatusableChoiceStatusSubscriberTest::assertTrue
Open

        $this->assertTrue(is_callable(array($this->subscriber, 'preSetData')));

Call to method when from undeclared class \Phake
Open

        Phake::when($this->object)->getId()->thenReturn(null);

Call to method never from undeclared class \Phake
Open

        Phake::verify($this->form, Phake::never())->add(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($this->event)->getForm()->thenReturn($this->form);

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

class StatusableChoiceStatusSubscriberTest extends AbstractBaseTestCase

Call to method mock from undeclared class \Phake
Open

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

Call to method mock from undeclared class \Phake
Open

        $this->authorizationChecker = Phake::mock('Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface');

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->form, Phake::never())->add(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

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

Call to method mock from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($this->object)->getStatus()->thenReturn($status);

Parameter $status has undeclared type \OpenOrchestra\ModelInterface\Model\StatusInterface
Open

    public function testPreSetData($status, $isGranted, array $expectedStatus)

Call to method when from undeclared class \Phake
Open

        Phake::when($this->authorizationChecker)->isGranted(Phake::anyParameters())->thenReturn($isGranted);

Call to method mock from undeclared class \Phake
Open

        $this->object = Phake::mock('OpenOrchestra\ModelBundle\Document\Node');

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->form, Phake::never())->add(Phake::anyParameters());

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->form, Phake::times(1))->add(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($this->object)->getId()->thenReturn('fakeId');

Line exceeds 120 characters; contains 129 characters
Open

        $this->authorizationChecker = Phake::mock('Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface');

Line exceeds 120 characters; contains 147 characters
Open

        $this->subscriber = new StatusableChoiceStatusSubscriber($this->statusRepository, $this->authorizationChecker, $this->objectManager, array(

There are no issues that match your filters.

Category
Status