open-orchestra/open-orchestra-cms-bundle

View on GitHub
Backoffice/Tests/BusinessRules/Strategies/ContentStrategyTest.php

Summary

Maintainability
A
2 hrs
Test Coverage

Method provideDeleteVersionContent has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function provideDeleteVersionContent()
    {
        $status0 = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');
        Phake::when($status0)->isPublishedState()->thenReturn(false);
        $content0 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');
Severity: Minor
Found in Backoffice/Tests/BusinessRules/Strategies/ContentStrategyTest.php - About 1 hr to fix

Method provideEditContent has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function provideEditContent()
    {
        $status0 = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');
        Phake::when($status0)->isBlockedEdition()->thenReturn(false);
        $content0 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');
Severity: Minor
Found in Backoffice/Tests/BusinessRules/Strategies/ContentStrategyTest.php - About 1 hr to fix

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

        $status3 = 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->siteRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\SiteRepositoryInterface');

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

        $content0 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

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 'provideEditContent'.
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 'provideDeleteContent'.
Open

        $content0 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

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->contextManager = 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

        $site = Phake::mock('OpenOrchestra\ModelInterface\Model\SiteInterface');

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

        $status1 = 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 'provideEditContent'.
Open

        $content1 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

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

        $status1 = 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 'provideEditContent'.
Open

        $content3 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

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

        $status0 = 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->contentRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\ContentRepositoryInterface');

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

        $status0 = 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 'provideEditContent'.
Open

        $status3 = 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 'provideDeleteVersionContent'.
Open

        $content1 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

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

        $content2 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

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

        $content3 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

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

        $content1 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

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

        Phake::when($this->contentRepository)->countNotDeletedByLanguage(Phake::anyParameters())->thenReturn($nbrVersions);

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

        $content2 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

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

        $content1 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

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

        $content0 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

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

        $content0 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

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($content1)->getContentType()->thenReturn($this->notAllowedContentType);

Parameter $content has undeclared type \OpenOrchestra\ModelInterface\Model\ContentInterface
Open

    public function testCanDeleteVersion(ContentInterface $content, $nbrVersions, $isGranted)

Call to method mock from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($content1)->getContentType()->thenReturn($this->allowedContentType);

Call to method when from undeclared class \Phake
Open

        Phake::when($content0)->getContentType()->thenReturn($this->allowedContentType);

Parameter $content has undeclared type \OpenOrchestra\ModelInterface\Model\ContentInterface
Open

    public function testCanEdit(ContentInterface $content, $isGranted)

Call to method mock from undeclared class \Phake
Open

        $content0 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($content1)->getStatus()->thenReturn($status1);

Call to method when from undeclared class \Phake
Open

        Phake::when($content1)->getContentId()->thenReturn('fakeContentId1');

Call to method when from undeclared class \Phake
Open

        Phake::when($content1)->getStatus()->thenReturn($status1);

Call to undeclared method \OpenOrchestra\BackOffice\Tests\BusinessRules\Strategies\ContentStrategyTest::assertSame
Open

        $this->assertSame($isGranted, $this->strategy->canDelete($content, array()));

Call to method mock from undeclared class \Phake
Open

        $content1 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($content0)->getStatus()->thenReturn($status0);

Call to method when from undeclared class \Phake
Open

        Phake::when($content2)->getContentType()->thenReturn($this->notAllowedContentType);

Call to method when from undeclared class \Phake
Open

        Phake::when($content2)->getStatus()->thenReturn($status2);

Call to method when from undeclared class \Phake
Open

        Phake::when($status3)->isPublishedState()->thenReturn(true);

Call to method mock from undeclared class \Phake
Open

        $content0 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

Call to method mock from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($status0)->isBlockedEdition()->thenReturn(false);

Call to method mock from undeclared class \Phake
Open

        $content3 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($content0)->getContentId()->thenReturn('fakeContentId0');

Call to method when from undeclared class \Phake
Open

        Phake::when($status1)->isPublishedState()->thenReturn(true);

Call to method mock from undeclared class \Phake
Open

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

Reference to constant ENTITY_TYPE from undeclared class \OpenOrchestra\ModelInterface\Model\ContentInterface
Open

        $this->assertEquals(ContentInterface::ENTITY_TYPE, $this->strategy->getType());

Call to method mock from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($content1)->getContentType()->thenReturn($this->allowedContentType);

Call to method mock from undeclared class \Phake
Open

        $content0 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($content0)->getContentType()->thenReturn($this->allowedContentType);

Call to method mock from undeclared class \Phake
Open

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

Call to method mock from undeclared class \Phake
Open

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

Call to method mock from undeclared class \Phake
Open

        $content0 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

Call to method mock from undeclared class \Phake
Open

        $content1 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

Call to method getContentId from undeclared class \OpenOrchestra\ModelInterface\Model\ContentInterface
Open

        Phake::when($this->contentRepository)->hasContentIdWithoutAutoUnpublishToState($content->getContentId())->thenReturn($isWithoutAutoUnpublishToState);

Call to method when from undeclared class \Phake
Open

        Phake::when($status0)->isPublishedState()->thenReturn(false);

Call to method mock from undeclared class \Phake
Open

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

Argument 1 (content) is int but \OpenOrchestra\Backoffice\BusinessRules\Strategies\ContentStrategy::canRead() takes \OpenOrchestra\ModelInterface\Model\ContentInterface defined at /code/Backoffice/BusinessRules/Strategies/ContentStrategy.php:96
Open

        $this->assertSame($isGranted, $this->strategy->canRead($content, array()));

Call to method when from undeclared class \Phake
Open

        Phake::when($content0)->getContentType()->thenReturn($this->allowedContentType);

Parameter $content has undeclared type \OpenOrchestra\ModelInterface\Model\ContentInterface
Open

    public function testCanDelete(ContentInterface $content, $isWithoutAutoUnpublishToState, $isGranted)

Call to method when from undeclared class \Phake
Open

        Phake::when($site)->getContentTypes()->thenReturn(array(

Call to undeclared method \OpenOrchestra\BackOffice\Tests\BusinessRules\Strategies\ContentStrategyTest::assertSame
Open

        $this->assertSame($isGranted, $this->strategy->canEdit($content, array()));

Call to method when from undeclared class \Phake
Open

        Phake::when($content2)->getStatus()->thenReturn($status2);

Call to method when from undeclared class \Phake
Open

        Phake::when($content3)->getStatus()->thenReturn($status3);

Call to method mock from undeclared class \Phake
Open

        $content3 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($content0)->getContentType()->thenReturn($this->allowedContentType);

Call to method mock from undeclared class \Phake
Open

        $content1 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

Call to undeclared method \OpenOrchestra\BackOffice\Tests\BusinessRules\Strategies\ContentStrategyTest::assertEquals
Open

        $this->assertEquals(ContentInterface::ENTITY_TYPE, $this->strategy->getType());

Call to method when from undeclared class \Phake
Open

        Phake::when($this->siteRepository)->findOneBySiteId('fakeSiteId')->thenReturn($site);

Call to undeclared method \OpenOrchestra\BackOffice\Tests\BusinessRules\Strategies\ContentStrategyTest::assertSame
Open

        $this->assertSame($isGranted, $this->strategy->canDeleteVersion($content, array()));

Call to undeclared method \OpenOrchestra\BackOffice\Tests\BusinessRules\Strategies\ContentStrategyTest::assertSame
Open

        $this->assertSame($isGranted, $this->strategy->canRead($content, array()));

Call to method mock from undeclared class \Phake
Open

        $content1 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

Call to method mock from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($status1)->isBlockedEdition()->thenReturn(true);

Call to method mock from undeclared class \Phake
Open

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

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->contentRepository)->countNotDeletedByLanguage(Phake::anyParameters())->thenReturn($nbrVersions);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->contentRepository)->countNotDeletedByLanguage(Phake::anyParameters())->thenReturn($nbrVersions);

Call to method when from undeclared class \Phake
Open

        Phake::when($content3)->getContentType()->thenReturn($this->notAllowedContentType);

Call to method mock from undeclared class \Phake
Open

        $content2 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($content2)->getContentType()->thenReturn($this->notAllowedContentType);

Call to method when from undeclared class \Phake
Open

        Phake::when($content1)->getContentType()->thenReturn($this->notAllowedContentType);

Call to method mock from undeclared class \Phake
Open

        $site = Phake::mock('OpenOrchestra\ModelInterface\Model\SiteInterface');

Call to method mock from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($status3)->isBlockedEdition()->thenReturn(true);

Call to method when from undeclared class \Phake
Open

        Phake::when($content3)->getContentType()->thenReturn($this->notAllowedContentType);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->contextManager)->getSiteId()->thenReturn('fakeSiteId');

Call to method when from undeclared class \Phake
Open

        Phake::when($status2)->isBlockedEdition()->thenReturn(false);

Call to method when from undeclared class \Phake
Open

        Phake::when($content3)->getStatus()->thenReturn($status3);

Call to undeclared method \OpenOrchestra\BackOffice\Tests\BusinessRules\Strategies\ContentStrategyTest::assertEquals
Open

        $this->assertEquals(array(

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

class ContentStrategyTest extends AbstractBaseTestCase

Call to method when from undeclared class \Phake
Open

        Phake::when($content0)->getStatus()->thenReturn($status0);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->contentRepository)->hasContentIdWithoutAutoUnpublishToState($content->getContentId())->thenReturn($isWithoutAutoUnpublishToState);

Call to method mock from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($status2)->isPublishedState()->thenReturn(false);

Call to method mock from undeclared class \Phake
Open

        $content2 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

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

    protected $notAllowedContentType = 'notAllowedContentType';

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

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

    public function testCanDelete(ContentInterface $content, $isWithoutAutoUnpublishToState, $isGranted)

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

        Phake::when($this->contentRepository)->hasContentIdWithoutAutoUnpublishToState($content->getContentId())->thenReturn($isWithoutAutoUnpublishToState);

Line exceeds 120 characters; contains 123 characters
Open

        Phake::when($this->contentRepository)->countNotDeletedByLanguage(Phake::anyParameters())->thenReturn($nbrVersions);

There are no issues that match your filters.

Category
Status