YetiForceCompany/YetiForceCRM

View on GitHub
tests/App/Layout.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Avoid using static access to class '\App\Layout' in method 'testGetImagePath'.
Open

        $this->assertSame('public_html/layouts/basic/images/Accounts.png', \App\Layout::getImagePath('Accounts.png'), 'Image path differs from provided');
Severity: Minor
Found in tests/App/Layout.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\Layout' in method 'testGetLayoutFile'.
Open

        $this->assertFileDoesNotExist(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . \App\Layout::getLayoutFile('modules/Accounts/AccountHierarchy.tpl'), 'Expected file in provided path not exists');
Severity: Minor
Found in tests/App/Layout.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\Layout' in method 'testGetPublicUrl'.
Open

        $this->assertSame(\App\Config::main('site_URL') . 'public_html/unitTest', \App\Layout::getPublicUrl('unitTest', true), 'Url differs from reference');
Severity: Minor
Found in tests/App/Layout.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\Session' in method 'testGetActiveLayout'.
Open

        \App\Session::set('layout', \App\Config::main('defaultLayout'));
Severity: Minor
Found in tests/App/Layout.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\Layout' in method 'testGetLayoutFile'.
Open

        $this->assertFileExists(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . \App\Layout::getLayoutFile('modules/Accounts/resources/Detail.js'), 'Expected file in provided path');
Severity: Minor
Found in tests/App/Layout.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\Layout' in method 'testGetActiveLayout'.
Open

        $this->assertSame(\App\Config::main('defaultLayout'), \App\Layout::getActiveLayout(), 'Expected default layout(session)');
Severity: Minor
Found in tests/App/Layout.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\Layout\Icon' in method 'testGetIconByFileType'.
Open

        $this->assertSame('far fa-file-video', \App\Layout\Icon::getIconByFileType('video'), 'Expected icon class name(video)');
Severity: Minor
Found in tests/App/Layout.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\Layout' in method 'testGetAllLayouts'.
Open

        $result0 = \App\Layout::getAllLayouts();
Severity: Minor
Found in tests/App/Layout.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\Language' in method 'testGetAllLayouts'.
Open

        $this->assertSame(\App\Language::translate('LBL_DEFAULT'), $result0['basic'], 'Expected only default layout with standard label');
Severity: Minor
Found in tests/App/Layout.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\Config' in method 'testGetActiveLayout'.
Open

        $this->assertSame(\App\Config::main('defaultLayout'), \App\Layout::getActiveLayout(), 'Expected default layout');
Severity: Minor
Found in tests/App/Layout.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\Layout' in method 'testGetLayoutFile'.
Open

        $this->assertFileDoesNotExist(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . \App\Layout::getLayoutFile('styles/NxFile.css'), 'Expected file in provided path not exists');
Severity: Minor
Found in tests/App/Layout.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\Layout' in method 'testGetActiveLayout'.
Open

        $this->assertSame(\App\Config::main('defaultLayout'), \App\Layout::getActiveLayout(), 'Expected default layout');
Severity: Minor
Found in tests/App/Layout.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\Layout' in method 'testGetUniqueId'.
Open

        $this->assertSame(0, strpos(\App\Layout::getUniqueId('basic'), 'basic'), 'Unique ID should contain provided prefix');
Severity: Minor
Found in tests/App/Layout.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\Layout' in method 'testGetAllLayouts'.
Open

        $result1 = \App\Layout::getAllLayouts();
Severity: Minor
Found in tests/App/Layout.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\Config' in method 'testGetActiveLayout'.
Open

        \App\Session::set('layout', \App\Config::main('defaultLayout'));
Severity: Minor
Found in tests/App/Layout.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\Config' in method 'testGetActiveLayout'.
Open

        $this->assertSame(\App\Config::main('defaultLayout'), \App\Layout::getActiveLayout(), 'Expected default layout(session)');
Severity: Minor
Found in tests/App/Layout.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\Layout\Icon' in method 'testGetIconByFileType'.
Open

        $this->assertSame('yfm-Documents', \App\Layout\Icon::getIconByFileType('NotExists'), 'Expected icon class name(text/vcard)');
Severity: Minor
Found in tests/App/Layout.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\Layout' in method 'testGetTemplatePath'.
Open

        $this->assertSame('modules/Vtiger/basic', \App\Layout::getTemplatePath('basic'), 'Tempate path differs from provided');
Severity: Minor
Found in tests/App/Layout.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\Layout\Icon' in method 'testGetIconByFileType'.
Open

        $this->assertSame('fas fa-calendar-alt', \App\Layout\Icon::getIconByFileType('text/vcard'), 'Expected icon class name(text/vcard)');
Severity: Minor
Found in tests/App/Layout.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\Config' in method 'testGetPublicUrl'.
Open

        $this->assertSame(\App\Config::main('site_URL') . 'public_html/unitTest', \App\Layout::getPublicUrl('unitTest', true), 'Url differs from reference');
Severity: Minor
Found in tests/App/Layout.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

Define a constant instead of duplicating this literal "unitTest0" 3 times.
Open

        \App\Db::getInstance()->createCommand()->insert('vtiger_layout', ['name' => 'unitTest0', 'label' => 'UnitTest0'])->execute();
Severity: Critical
Found in tests/App/Layout.php by sonar-php

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Define a constant instead of duplicating this literal "basic" 4 times.
Open

        $this->assertSame(\App\Language::translate('LBL_DEFAULT'), $result0['basic'], 'Expected only default layout with standard label');
Severity: Critical
Found in tests/App/Layout.php by sonar-php

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Define a constant instead of duplicating this literal "defaultLayout" 3 times.
Open

        $this->assertSame(\App\Config::main('defaultLayout'), \App\Layout::getActiveLayout(), 'Expected default layout');
Severity: Critical
Found in tests/App/Layout.php by sonar-php

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Define a constant instead of duplicating this literal "UnitTest0" 3 times.
Open

        \App\Db::getInstance()->createCommand()->insert('vtiger_layout', ['name' => 'unitTest0', 'label' => 'UnitTest0'])->execute();
Severity: Critical
Found in tests/App/Layout.php by sonar-php

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Call to undeclared method \Tests\App\Layout::assertSame
Open

        $this->assertSame(\App\Config::main('defaultLayout'), \App\Layout::getActiveLayout(), 'Expected default layout');
Severity: Critical
Found in tests/App/Layout.php by phan

Call to undeclared method \Tests\App\Layout::assertSame
Open

        $this->assertSame('yfm-Documents', \App\Layout\Icon::getIconByFileType('NotExists'), 'Expected icon class name(text/vcard)');
Severity: Critical
Found in tests/App/Layout.php by phan

Call to undeclared method \Tests\App\Layout::assertSame
Open

        $this->assertSame('UnitTest0', $result1['unitTest0'], 'Expected test layout with reference label');
Severity: Critical
Found in tests/App/Layout.php by phan

Call to undeclared method \App\Db::createCommand
Open

        \App\Db::getInstance()->createCommand()->insert('vtiger_layout', ['name' => 'unitTest0', 'label' => 'UnitTest0'])->execute();
Severity: Critical
Found in tests/App/Layout.php by phan

Call to undeclared method \Tests\App\Layout::assertCount
Open

        $this->assertCount(1, $result0, 'Expected only default layout');
Severity: Critical
Found in tests/App/Layout.php by phan

Call to undeclared method \Tests\App\Layout::assertSame
Open

        $this->assertSame(\App\Config::main('defaultLayout'), \App\Layout::getActiveLayout(), 'Expected default layout(session)');
Severity: Critical
Found in tests/App/Layout.php by phan

Call to undeclared method \Tests\App\Layout::assertFileDoesNotExist
Open

        $this->assertFileDoesNotExist(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . \App\Layout::getLayoutFile('styles/NxFile.css'), 'Expected file in provided path not exists');
Severity: Critical
Found in tests/App/Layout.php by phan

Call to undeclared method \Tests\App\Layout::assertSame
Open

        $this->assertSame('public_html/layouts/basic/images/Accounts.png', \App\Layout::getImagePath('Accounts.png'), 'Image path differs from provided');
Severity: Critical
Found in tests/App/Layout.php by phan

Call to undeclared method \Tests\App\Layout::assertSame
Open

        $this->assertSame('modules/Vtiger/basic', \App\Layout::getTemplatePath('basic'), 'Tempate path differs from provided');
Severity: Critical
Found in tests/App/Layout.php by phan

Call to undeclared method \Tests\App\Layout::assertSame
Open

        $this->assertSame('far fa-file-video', \App\Layout\Icon::getIconByFileType('video'), 'Expected icon class name(video)');
Severity: Critical
Found in tests/App/Layout.php by phan

Call to undeclared method \Tests\App\Layout::assertCount
Open

        $this->assertCount(2, $result1, 'Expected only two layouts, default and unitTest0');
Severity: Critical
Found in tests/App/Layout.php by phan

Call to undeclared method \Tests\App\Layout::assertSame
Open

        $this->assertSame(\App\Language::translate('LBL_DEFAULT'), $result0['basic'], 'Expected only default layout with standard label');
Severity: Critical
Found in tests/App/Layout.php by phan

Call to undeclared method \Tests\App\Layout::assertSame
Open

        $this->assertSame(0, strpos(\App\Layout::getUniqueId('basic'), 'basic'), 'Unique ID should contain provided prefix');
Severity: Critical
Found in tests/App/Layout.php by phan

Call to undeclared method \Tests\App\Layout::assertSame
Open

        $this->assertSame('fas fa-calendar-alt', \App\Layout\Icon::getIconByFileType('text/vcard'), 'Expected icon class name(text/vcard)');
Severity: Critical
Found in tests/App/Layout.php by phan

Call to undeclared method \Tests\App\Layout::assertFileDoesNotExist
Open

        $this->assertFileDoesNotExist(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . \App\Layout::getLayoutFile('modules/Accounts/AccountHierarchy.tpl'), 'Expected file in provided path not exists');
Severity: Critical
Found in tests/App/Layout.php by phan

Call to undeclared method \Tests\App\Layout::assertFileExists
Open

        $this->assertFileExists(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . \App\Layout::getLayoutFile('modules/Accounts/resources/Detail.js'), 'Expected file in provided path');
Severity: Critical
Found in tests/App/Layout.php by phan

Call to undeclared method \App\Db::createCommand
Open

        \App\Db::getInstance()->createCommand()->delete('vtiger_layout', ['name' => 'unitTest0', 'label' => 'UnitTest0'])->execute();
Severity: Critical
Found in tests/App/Layout.php by phan

Call to undeclared method \Tests\App\Layout::assertSame
Open

        $this->assertSame(\App\Config::main('site_URL') . 'public_html/unitTest', \App\Layout::getPublicUrl('unitTest', true), 'Url differs from reference');
Severity: Critical
Found in tests/App/Layout.php by phan

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

        $result0 = \App\Layout::getAllLayouts();
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

        $this->assertCount(2, $result1, 'Expected only two layouts, default and unitTest0');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    {
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

Line exceeds 120 characters; contains 157 characters
Open

        $this->assertSame(\App\Config::main('site_URL') . 'public_html/unitTest', \App\Layout::getPublicUrl('unitTest', true), 'Url differs from reference');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

     * Testing getUniqueId function.
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

Line exceeds 120 characters; contains 133 characters
Open

        $this->assertSame('yfm-Documents', \App\Layout\Icon::getIconByFileType('NotExists'), 'Expected icon class name(text/vcard)');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

     * Testing getLayoutFile function.
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

        $this->assertFileExists(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . \App\Layout::getLayoutFile('modules/Accounts/resources/Detail.js'), 'Expected file in provided path');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    }
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

     */
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

     */
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    public function testGetImagePath()
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

        $this->assertSame('public_html/layouts/basic/images/Accounts.png', \App\Layout::getImagePath('Accounts.png'), 'Image path differs from provided');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    {
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    /**
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

     * Testing getIconByFileType function.
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    {
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

        \App\Db::getInstance()->createCommand()->insert('vtiger_layout', ['name' => 'unitTest0', 'label' => 'UnitTest0'])->execute();
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

        $this->assertSame(\App\Config::main('site_URL') . 'public_html/unitTest', \App\Layout::getPublicUrl('unitTest', true), 'Url differs from reference');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    /**
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    /**
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    public function testGetIconByFileType()
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

        $this->assertSame('fas fa-calendar-alt', \App\Layout\Icon::getIconByFileType('text/vcard'), 'Expected icon class name(text/vcard)');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

        $this->assertFileDoesNotExist(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . \App\Layout::getLayoutFile('modules/Accounts/AccountHierarchy.tpl'), 'Expected file in provided path not exists');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    }
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    {
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

Line exceeds 120 characters; contains 133 characters
Open

        \App\Db::getInstance()->createCommand()->insert('vtiger_layout', ['name' => 'unitTest0', 'label' => 'UnitTest0'])->execute();
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    public function testGetUniqueId()
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

        $this->assertSame(0, strpos(\App\Layout::getUniqueId('basic'), 'basic'), 'Unique ID should contain provided prefix');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    {
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

        $this->assertSame(\App\Config::main('defaultLayout'), \App\Layout::getActiveLayout(), 'Expected default layout');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

        $this->assertSame(\App\Config::main('defaultLayout'), \App\Layout::getActiveLayout(), 'Expected default layout(session)');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

     */
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

        $this->assertSame('far fa-file-video', \App\Layout\Icon::getIconByFileType('video'), 'Expected icon class name(video)');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

     * Testing getActiveLayout function.
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

Line exceeds 120 characters; contains 121 characters
Open

        $this->assertSame(\App\Config::main('defaultLayout'), \App\Layout::getActiveLayout(), 'Expected default layout');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

        $this->assertFileDoesNotExist(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . \App\Layout::getLayoutFile('styles/NxFile.css'), 'Expected file in provided path not exists');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

     */
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    public function testGetLayoutFile()
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

Line exceeds 120 characters; contains 192 characters
Open

        $this->assertFileDoesNotExist(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . \App\Layout::getLayoutFile('modules/Accounts/AccountHierarchy.tpl'), 'Expected file in provided path not exists');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    public function testGetAllLayouts()
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

     * Testing getImagePath.
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    public function testGetTemplatePath()
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

        $this->assertSame('yfm-Documents', \App\Layout\Icon::getIconByFileType('NotExists'), 'Expected icon class name(text/vcard)');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

     */
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    /**
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

        $this->assertCount(1, $result0, 'Expected only default layout');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    {
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    {
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    }
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

     */
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

Line exceeds 120 characters; contains 174 characters
Open

        $this->assertFileExists(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . \App\Layout::getLayoutFile('modules/Accounts/resources/Detail.js'), 'Expected file in provided path');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

     */
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

        $result1 = \App\Layout::getAllLayouts();
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    /**
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

     */
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    {
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

        \App\Db::getInstance()->createCommand()->delete('vtiger_layout', ['name' => 'unitTest0', 'label' => 'UnitTest0'])->execute();
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

     * Testing getPublicUrl.
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    }
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

Line exceeds 120 characters; contains 125 characters
Open

        $this->assertSame(0, strpos(\App\Layout::getUniqueId('basic'), 'basic'), 'Unique ID should contain provided prefix');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

Line exceeds 120 characters; contains 128 characters
Open

        $this->assertSame('far fa-file-video', \App\Layout\Icon::getIconByFileType('video'), 'Expected icon class name(video)');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    }
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

Line exceeds 120 characters; contains 172 characters
Open

        $this->assertFileDoesNotExist(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . \App\Layout::getLayoutFile('styles/NxFile.css'), 'Expected file in provided path not exists');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

        $this->assertSame(\App\Language::translate('LBL_DEFAULT'), $result0['basic'], 'Expected only default layout with standard label');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

        $this->assertSame('UnitTest0', $result1['unitTest0'], 'Expected test layout with reference label');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    /**
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    }
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

Line exceeds 120 characters; contains 140 characters
Open

        $this->assertSame('fas fa-calendar-alt', \App\Layout\Icon::getIconByFileType('text/vcard'), 'Expected icon class name(text/vcard)');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

Line exceeds 120 characters; contains 130 characters
Open

        $this->assertSame(\App\Config::main('defaultLayout'), \App\Layout::getActiveLayout(), 'Expected default layout(session)');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

     * Testing getAllLayouts function.
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

     * Testing getTemplatePath function.
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

        $this->assertSame('modules/Vtiger/basic', \App\Layout::getTemplatePath('basic'), 'Tempate path differs from provided');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

Line exceeds 120 characters; contains 127 characters
Open

        $this->assertSame('modules/Vtiger/basic', \App\Layout::getTemplatePath('basic'), 'Tempate path differs from provided');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    public function testGetActiveLayout()
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

        \App\Session::set('layout', \App\Config::main('defaultLayout'));
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

Line exceeds 120 characters; contains 133 characters
Open

        \App\Db::getInstance()->createCommand()->delete('vtiger_layout', ['name' => 'unitTest0', 'label' => 'UnitTest0'])->execute();
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    public function testGetPublicUrl()
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    }
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

Line exceeds 120 characters; contains 154 characters
Open

        $this->assertSame('public_html/layouts/basic/images/Accounts.png', \App\Layout::getImagePath('Accounts.png'), 'Image path differs from provided');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    }
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    /**
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

Line exceeds 120 characters; contains 138 characters
Open

        $this->assertSame(\App\Language::translate('LBL_DEFAULT'), $result0['basic'], 'Expected only default layout with standard label');
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

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

    /**
Severity: Minor
Found in tests/App/Layout.php by phpcodesniffer

There are no issues that match your filters.

Category
Status