YetiForceCompany/YetiForceCRM

View on GitHub
tests/Base/H_Permissions.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Avoid using static access to class '\App\Privilege' in method 'testIsPermitted'.
Open

        $this->assertTrue(\App\Privilege::isPermitted('Accounts', 'DetailView', \Tests\Base\C_RecordActions::createAccountRecord()->getId()));
Severity: Minor
Found in tests/Base/H_Permissions.php by phpmd

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 '\App\UserPrivilegesFile' in method 'testRecalculateSharingRules'.
Open

        \App\UserPrivilegesFile::recalculateAll();
Severity: Minor
Found in tests/Base/H_Permissions.php by phpmd

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 '\App\Module' in method 'testCreateModuleMetaFile'.
Open

        \App\Module::createModuleMetaFile();
Severity: Minor
Found in tests/Base/H_Permissions.php by phpmd

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 \Tests\Base\H_Permissions::assertTrue
Open

        $this->assertTrue(\App\Privilege::isPermitted('Accounts', 'DetailView', \Tests\Base\C_RecordActions::createAccountRecord()->getId()));
Severity: Critical
Found in tests/Base/H_Permissions.php by phan

Call to undeclared method \Tests\Base\H_Permissions::assertTrue
Open

        $this->assertTrue(true);
Severity: Critical
Found in tests/Base/H_Permissions.php by phan

Call to undeclared method \Tests\Base\H_Permissions::assertTrue
Open

        $this->assertTrue(true);
Severity: Critical
Found in tests/Base/H_Permissions.php by phan

The class H_Permissions is not named in CamelCase.
Open

class H_Permissions extends \Tests\Base
{
    /**
     * Testing record permissions.
     */
Severity: Minor
Found in tests/Base/H_Permissions.php by phpmd

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Line exceeds 120 characters; contains 142 characters
Open

        $this->assertTrue(\App\Privilege::isPermitted('Accounts', 'DetailView', \Tests\Base\C_RecordActions::createAccountRecord()->getId()));
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->assertTrue(true);
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Testing record permissions.
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function testCreateModuleMetaFile()
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Testing refreshing module meta files.
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Testing refreshing permission files.
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        \App\Module::createModuleMetaFile();
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function testRecalculateSharingRules()
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->assertTrue(true);
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        \App\UserPrivilegesFile::recalculateAll();
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function testIsPermitted()
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->assertTrue(\App\Privilege::isPermitted('Accounts', 'DetailView', \Tests\Base\C_RecordActions::createAccountRecord()->getId()));
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

Class name "H_Permissions" is not in camel caps format
Open

class H_Permissions extends \Tests\Base
Severity: Minor
Found in tests/Base/H_Permissions.php by phpcodesniffer

There are no issues that match your filters.

Category
Status