YetiForceCompany/YetiForceCRM

View on GitHub
tests/Settings/ConfReport.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Avoid using static access to class '\App\Utils\ConfReport' in method 'setUpBeforeClass'.
Open

        self::$confReportAll = \App\Utils\ConfReport::getAll();
Severity: Minor
Found in tests/Settings/ConfReport.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\Utils\ConfReport' in method 'testSystemInfo'.
Open

        $this->assertNotEmpty(\App\Utils\ConfReport::getConfig(), 'System information report should be not empty');
Severity: Minor
Found in tests/Settings/ConfReport.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\Settings\ConfReport::assertNotEmpty
Open

        $this->assertNotEmpty(\App\Utils\ConfReport::getConfig(), 'System information report should be not empty');
Severity: Critical
Found in tests/Settings/ConfReport.php by phan

Call to method getAll from undeclared class \App\Utils\ConfReport (Did you mean class \Tests\Settings\ConfReport)
Open

        self::$confReportAll = \App\Utils\ConfReport::getAll();
Severity: Critical
Found in tests/Settings/ConfReport.php by phan

Call to undeclared method \Tests\Settings\ConfReport::assertIsArray
Open

        $this->assertIsArray(
Severity: Critical
Found in tests/Settings/ConfReport.php by phan

Call to method getConfig from undeclared class \App\Utils\ConfReport (Did you mean class \Tests\Settings\ConfReport)
Open

        $this->assertNotEmpty(\App\Utils\ConfReport::getConfig(), 'System information report should be not empty');
Severity: Critical
Found in tests/Settings/ConfReport.php by phan

Call to undeclared method \Tests\Settings\ConfReport::assertIsArray
Open

        $this->assertIsArray(
Severity: Critical
Found in tests/Settings/ConfReport.php by phan

Call to undeclared method \Tests\Settings\ConfReport::assertNotEmpty
Open

        $this->assertNotEmpty(\App\Db::getInstance()->getInfo(), 'Database configuration report should be not empty');
Severity: Critical
Found in tests/Settings/ConfReport.php by phan

Call to undeclared method \Tests\Settings\ConfReport::assertIsArray
Open

        $this->assertIsArray(
Severity: Critical
Found in tests/Settings/ConfReport.php by phan

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

    public static $confReportAll;

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

     * Testing database configuration report.

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

            'Database configuration report should be array even if empty'

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

    /**

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

     * @var array

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

     * @codeCoverageIgnore

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

    }

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

    {

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

    {

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

    public function testSystemInfo()

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

     *

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

        $this->assertIsArray(

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

        );

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

    }

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

     * Testing system stability configuration report.

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

        $this->assertIsArray(

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

     * All configuration values.

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

    {

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

            self::$confReportAll['stability'] ?? null,

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

            'Security configuration (normal mode, show all) report should be not empty'

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

     */

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

        $this->assertNotEmpty(\App\Db::getInstance()->getInfo(), 'Database configuration report should be not empty');

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

        );

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

     * Testing security configuration report.

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

        $this->assertNotEmpty(\App\Utils\ConfReport::getConfig(), 'System information report should be not empty');

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

    {

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

     * Testing system informations report.

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

    /**

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

    /**

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

        $this->assertIsArray(

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

     */

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

    public function testSecurityConf()

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

            'Security configuration (normal mode, show all) report should be not empty'

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

    public function testDbConf()

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

    }

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

        );

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

     */

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

     * Setting of tests.

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

     */

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

    {

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

    }

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

    }

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

    public function testStabilityConf()

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

    public static function setUpBeforeClass(): void

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

     */

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

    /**

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

        self::$confReportAll = \App\Utils\ConfReport::getAll();

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

            self::$confReportAll['security'] ?? null,

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

    /**

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

     */

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

            \App\Db::getInstance()->getInfo(),

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

    /**

There are no issues that match your filters.

Category
Status