YetiForceCompany/YetiForceCRM

View on GitHub
tests/Base/J_MultiCompany.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Avoid using undefined variables such as '$attach' which will lead to PHP notices.
Open

        $attach[] = [
Severity: Minor
Found in tests/Base/J_MultiCompany.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$attach' which will lead to PHP notices.
Open

        $recordModel->set('logo', \App\Json::encode($attach));
Severity: Minor
Found in tests/Base/J_MultiCompany.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Missing class import via use statement (line '86', column '22').
Open

        $recordModel = new \Settings_Roles_Record_Model();
Severity: Minor
Found in tests/Base/J_MultiCompany.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Avoid using static access to class '\App\User' in method 'testReloadByMultiCompany'.
Open

        $userModel = \App\User::getUserModel(self::$user->getId());
Severity: Minor
Found in tests/Base/J_MultiCompany.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\User' in method 'createMultiCompanyRecord'.
Open

        $recordModel->set('assigned_user_id', \App\User::getCurrentUserId());
Severity: Minor
Found in tests/Base/J_MultiCompany.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\Fields\File' in method 'testReloadByMultiCompany'.
Open

        $fileObj = \App\Fields\File::loadFromPath($filePathDestination);
Severity: Minor
Found in tests/Base/J_MultiCompany.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 '\Settings_Roles_Record_Model' in method 'createRole'.
Open

        $parentRole = \Settings_Roles_Record_Model::getInstanceById($parentRoleId);
Severity: Minor
Found in tests/Base/J_MultiCompany.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\Json' in method 'testReloadByMultiCompany'.
Open

        $recordModel->set('logo', \App\Json::encode($attach));
Severity: Minor
Found in tests/Base/J_MultiCompany.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\Json' in method 'testReloadByMultiCompany'.
Open

        $data = \App\Json::decode(\App\Purifier::decodeHtml($fieldModel->getUITypeModel()->getDisplayValueEncoded($recordModel->get('logo'), $recordModel->getId(), $fieldModel->getFieldInfo())));
Severity: Minor
Found in tests/Base/J_MultiCompany.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\Purifier' in method 'testReloadByMultiCompany'.
Open

        $data = \App\Json::decode(\App\Purifier::decodeHtml($fieldModel->getUITypeModel()->getDisplayValueEncoded($recordModel->get('logo'), $recordModel->getId(), $fieldModel->getFieldInfo())));
Severity: Minor
Found in tests/Base/J_MultiCompany.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 '\Settings_Roles_Record_Model' in method 'tearDownAfterClass'.
Open

        self::$role->delete(\Settings_Roles_Record_Model::getInstanceById('H1'));
Severity: Minor
Found in tests/Base/J_MultiCompany.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 '\Vtiger_Record_Model' in method 'createUser'.
Open

        $recordModel = \Vtiger_Record_Model::getCleanInstance('Users');
Severity: Minor
Found in tests/Base/J_MultiCompany.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 '\Vtiger_Record_Model' in method 'createMultiCompanyRecord'.
Open

        $recordModel = \Vtiger_Record_Model::getCleanInstance('MultiCompany');
Severity: Minor
Found in tests/Base/J_MultiCompany.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 '\Users_Record_Model' in method 'tearDownAfterClass'.
Open

        \Users_Record_Model::deleteUserPermanently(self::$user->getId(), \Users_Record_Model::getCurrentUserModel()->getId());
Severity: Minor
Found in tests/Base/J_MultiCompany.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 "0.jpg" 4 times.
Open

        $filePath = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'tests' . \DIRECTORY_SEPARATOR . 'data' . \DIRECTORY_SEPARATOR . 'MultiImage' . \DIRECTORY_SEPARATOR . '0.jpg';
Severity: Critical
Found in tests/Base/J_MultiCompany.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.

Doc-block of createRole contains declared return type \void which is incompatible with the return type void declared in the signature
Open

     * @return \void
Severity: Minor
Found in tests/Base/J_MultiCompany.php by phan

Call to undeclared method \Tests\Base\J_MultiCompany::assertSame
Open

        $this->assertSame($hash, $data[0]['key']);
Severity: Critical
Found in tests/Base/J_MultiCompany.php by phan

Return type of createRole() is undeclared type \void
Open

    public static function createRole(): void
Severity: Minor
Found in tests/Base/J_MultiCompany.php by phan

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

        $this->assertTrue(self::$recordMultiCompany->privilegeToDelete());
Severity: Critical
Found in tests/Base/J_MultiCompany.php by phan

Variable $attach was undeclared, but array fields are being added to it.
Open

        $attach[] = [
Severity: Info
Found in tests/Base/J_MultiCompany.php by phan

Doc-block of createMultiCompanyRecord contains declared return type \void which is incompatible with the return type void declared in the signature
Open

     * @return \void
Severity: Minor
Found in tests/Base/J_MultiCompany.php by phan

Return type of createMultiCompanyRecord() is undeclared type \void
Open

    public static function createMultiCompanyRecord(): void
Severity: Minor
Found in tests/Base/J_MultiCompany.php by phan

Argument 1 (roleId) is 'H1' but \Settings_Roles_Record_Model::getInstanceById() takes int defined at /code/modules/Settings/Roles/models/Record.php:493
Open

        self::$role->delete(\Settings_Roles_Record_Model::getInstanceById('H1'));
Severity: Minor
Found in tests/Base/J_MultiCompany.php by phan

Call to undeclared method \Vtiger_Base_UIType::getDisplayValueEncoded
Open

        $data = \App\Json::decode(\App\Purifier::decodeHtml($fieldModel->getUITypeModel()->getDisplayValueEncoded($recordModel->get('logo'), $recordModel->getId(), $fieldModel->getFieldInfo())));
Severity: Critical
Found in tests/Base/J_MultiCompany.php by phan

Call to undeclared method \Tests\Base\J_MultiCompany::assertSame
Open

        $this->assertSame('0.jpg', $data[0]['name']);
Severity: Critical
Found in tests/Base/J_MultiCompany.php by phan

Call to undeclared method \Tests\Base\J_MultiCompany::assertSame
Open

        $this->assertSame($multiCompanyLogo['name'], $data[0]['name']);
Severity: Critical
Found in tests/Base/J_MultiCompany.php by phan

Call to method getCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
Open

        $recordModel->set('assigned_user_id', \App\User::getCurrentUserId());
Severity: Critical
Found in tests/Base/J_MultiCompany.php by phan

Call to method getUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
Open

        $userModel = \App\User::getUserModel(self::$user->getId());
Severity: Critical
Found in tests/Base/J_MultiCompany.php by phan

Call to undeclared method \Tests\Base\J_MultiCompany::assertSame
Open

        $this->assertSame($multiCompanyLogo['key'], $data[0]['key']);
Severity: Critical
Found in tests/Base/J_MultiCompany.php by phan

Argument 1 (roleId) is 'H1' but \Settings_Roles_Record_Model::getInstanceById() takes int defined at /code/modules/Settings/Roles/models/Record.php:493
Open

        $parentRole = \Settings_Roles_Record_Model::getInstanceById($parentRoleId);
Severity: Minor
Found in tests/Base/J_MultiCompany.php by phan

Call to undeclared method \Tests\Base\J_MultiCompany::assertFalse
Open

        $this->assertFalse(self::$recordMultiCompany->privilegeToDelete());
Severity: Critical
Found in tests/Base/J_MultiCompany.php by phan

Call to undeclared method \Tests\Base\J_MultiCompany::assertSame
Open

        $this->assertSame($fileObj->getSize(), $data[0]['size']);
Severity: Critical
Found in tests/Base/J_MultiCompany.php by phan

The class J_MultiCompany is not named in CamelCase.
Open

class J_MultiCompany extends \Tests\Base
{
    /**
     * Temporary User record object.
     *
Severity: Minor
Found in tests/Base/J_MultiCompany.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

     * Temporary User record object.

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

    /**

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

        $recordModel->set('user_name', 'TestMultiCompany');

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

     */

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

        $recordModel = \Vtiger_Record_Model::getCleanInstance('Users');

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

    /**

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

        $recordModel->set('company_name', 'TestMulti sp. z o.o.');

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

    protected static $user;

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

    public static function createUser(): void

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

        self::$user = $recordModel;

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

        $recordModel = new \Settings_Roles_Record_Model();

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

            ->set('permissionsrelatedfield', 0)

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

            ->set('allowassignedrecordsto', 1);

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

        self::createRole();

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

    public function testPrivilegeToDelete(): 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

        $filePathDestination = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'storage' . \DIRECTORY_SEPARATOR . '0.jpg';

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

        $recordModel->set('logo', \App\Json::encode($attach));

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

        $this->assertSame($hash, $data[0]['key']);

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

     * @return \void

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

     * Creating new role for test.

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::$role->save();

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

    }

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

    /**

Line exceeds 120 characters; contains 171 characters
Open

        $filePath = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'tests' . \DIRECTORY_SEPARATOR . 'data' . \DIRECTORY_SEPARATOR . 'MultiImage' . \DIRECTORY_SEPARATOR . '0.jpg';

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

        $recordModel->save();

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

     * Creating MultiCompany module record for 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

    public static function createRole(): void

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

            ->set('listrelatedrecord', 0)

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

            ->set('company', 1)

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

        $recordModel->save();

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

        \copy($filePath, $filePathDestination);

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

            'type' => $fileObj->getMimeType(),

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

    /**

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

     * Temporary MultiCompany record object.

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

    {

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

        $recordModel->set('first_name', 'Test');

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

        self::$role = $recordModel;

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 Reloaded by MultiCompany by image loading.

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

    public function testReloadByMultiCompany(): void

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

        $recordModel->save();

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

        $this->assertSame($fileObj->getSize(), $data[0]['size']);

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

    {

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

        $recordModel = \Vtiger_Record_Model::getCleanInstance('MultiCompany');

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

        $recordModel->set('email1', 'mail@testowy.pl');

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

        $hash = $fileObj->generateHash(true, $filePathDestination);

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

     *

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

        $recordModel->set('confirm_password', 'Demo12345678T');

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

        $recordModel->set('companyid1', '23123214141412');

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

            ->set('previewrelatedrecord', 0)

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

            ->set('globalsearchadv', 1)

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::$recordMultiCompany->delete();

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

        $recordModel->set('rolename', 'TestMultiSelect');

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

        $parentRole->addChildRole($recordModel);

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

    {

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

     * @return void

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

        self::$role->set('company', self::$recordMultiCompany->getId());

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

     */

Line exceeds 120 characters; contains 195 characters
Open

        $data = \App\Json::decode(\App\Purifier::decodeHtml($fieldModel->getUITypeModel()->getDisplayValueEncoded($recordModel->get('logo'), $recordModel->getId(), $fieldModel->getFieldInfo())));

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

        $recordModel->set('changeowner', 1)

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

    {

Line exceeds 120 characters; contains 126 characters
Open

        \Users_Record_Model::deleteUserPermanently(self::$user->getId(), \Users_Record_Model::getCurrentUserModel()->getId());

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

            ->set('auto_assign', 0)

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

     * @return void

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

        $this->assertTrue(self::$recordMultiCompany->privilegeToDelete());

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

    public function testNotPrivilegeToDelete(): 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

            'path' => $fileObj->getPath(),

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

        $this->assertSame($multiCompanyLogo['name'], $data[0]['name']);

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

     * Testing not privilege to delete.

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

     * @return 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

     */

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

    protected static $role;

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

        $recordModel->set('email1', 'testuser@yetiforce.com');

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

        $recordModel->set('roleid', self::$role->getId());

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

        $filePath = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'tests' . \DIRECTORY_SEPARATOR . 'data' . \DIRECTORY_SEPARATOR . 'MultiImage' . \DIRECTORY_SEPARATOR . '0.jpg';

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

            'name' => '0.jpg',

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

     * Cleaning after tests.

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

     * @var \Settings_Roles_Record_Model

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

     * Creating User module for tests.

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

    public static function createMultiCompanyRecord(): 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

            ->set('clendarallorecords', 3)

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

     * @return 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

        $this->assertFalse(self::$recordMultiCompany->privilegeToDelete());

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

    {

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

        $fieldModel = $recordModel->getField('logo');

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

        $this->assertSame('0.jpg', $data[0]['name']);

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

        \Users_Record_Model::deleteUserPermanently(self::$user->getId(), \Users_Record_Model::getCurrentUserModel()->getId());

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

     * @var \Vtiger_Record_Model

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

        $recordModel->set('is_admin', 'on');

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

     *

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

        $recordModel->save();

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::createMultiCompanyRecord();

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

     *

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

        $fileObj = \App\Fields\File::loadFromPath($filePathDestination);

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

            'key' => $hash,

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 \Vtiger_Record_Model

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

     * Temporary Roles Settings record object.

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

     * @return 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

        $recordModel->set('assigned_user_id', \App\User::getCurrentUserId());

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

     * @return \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

        $parentRole = \Settings_Roles_Record_Model::getInstanceById($parentRoleId);

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

     * Testing privilege to delete.

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

     */

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

        $attach[] = [

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 static function tearDownAfterClass(): void

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

            ->set('assignedmultiowner', 1)

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

     *

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

        $multiCompanyLogo = $userModel->get('multiCompanyLogo');

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

    /**

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

     * @return void

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

        self::$role->delete(\Settings_Roles_Record_Model::getInstanceById('H1'));

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

    protected static $recordMultiCompany;

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

        $recordModel->set('last_name', 'MultiCompany');

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

        $recordModel->set('user_password', 'Demo12345678T');

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

            ->set('editrelatedrecord', 0)

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

        self::createUser();

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

        $recordModel = self::$recordMultiCompany;

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->assertSame($multiCompanyLogo['key'], $data[0]['key']);

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

        self::$recordMultiCompany = $recordModel;

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

    /**

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

        $parentRoleId = 'H1';

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

            ->set('searchunpriv', null)

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

     * Setup data to tests.

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

        self::$recordMultiCompany->clearPrivilegesCache();

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

            'size' => $fileObj->getSize(),

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

        $userModel = \App\User::getUserModel(self::$user->getId());

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

        $data = \App\Json::decode(\App\Purifier::decodeHtml($fieldModel->getUITypeModel()->getDisplayValueEncoded($recordModel->get('logo'), $recordModel->getId(), $fieldModel->getFieldInfo())));

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

     */

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

class J_MultiCompany extends \Tests\Base

There are no issues that match your filters.

Category
Status