Avoid using undefined variables such as '$attach' which will lead to PHP notices. Open
$attach[] = [
- Read upRead up
- Exclude checks
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));
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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());
- Read upRead up
- Exclude checks
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());
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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));
- Read upRead up
- Exclude checks
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())));
- Read upRead up
- Exclude checks
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())));
- Read upRead up
- Exclude checks
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'));
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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());
- Read upRead up
- Exclude checks
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';
- Read upRead up
- Exclude checks
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
- Exclude checks
Call to undeclared method \Tests\Base\J_MultiCompany::assertSame
Open
$this->assertSame($hash, $data[0]['key']);
- Exclude checks
Return type of createRole()
is undeclared type \void
Open
public static function createRole(): void
- Exclude checks
Call to undeclared method \Tests\Base\J_MultiCompany::assertTrue
Open
$this->assertTrue(self::$recordMultiCompany->privilegeToDelete());
- Exclude checks
Variable $attach
was undeclared, but array fields are being added to it. Open
$attach[] = [
- Exclude checks
Doc-block of createMultiCompanyRecord
contains declared return type \void
which is incompatible with the return type void
declared in the signature Open
* @return \void
- Exclude checks
Return type of createMultiCompanyRecord()
is undeclared type \void
Open
public static function createMultiCompanyRecord(): void
- Exclude checks
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'));
- Exclude checks
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())));
- Exclude checks
Call to undeclared method \Tests\Base\J_MultiCompany::assertSame
Open
$this->assertSame('0.jpg', $data[0]['name']);
- Exclude checks
Call to undeclared method \Tests\Base\J_MultiCompany::assertSame
Open
$this->assertSame($multiCompanyLogo['name'], $data[0]['name']);
- Exclude checks
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());
- Exclude checks
Call to method getUserModel
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$userModel = \App\User::getUserModel(self::$user->getId());
- Exclude checks
Call to undeclared method \Tests\Base\J_MultiCompany::assertSame
Open
$this->assertSame($multiCompanyLogo['key'], $data[0]['key']);
- Exclude checks
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);
- Exclude checks
Call to undeclared method \Tests\Base\J_MultiCompany::assertFalse
Open
$this->assertFalse(self::$recordMultiCompany->privilegeToDelete());
- Exclude checks
Call to undeclared method \Tests\Base\J_MultiCompany::assertSame
Open
$this->assertSame($fileObj->getSize(), $data[0]['size']);
- Exclude checks
The class J_MultiCompany is not named in CamelCase. Open
class J_MultiCompany extends \Tests\Base
{
/**
* Temporary User record object.
*
- Read upRead up
- Exclude checks
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.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('user_name', 'TestMultiCompany');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = \Vtiger_Record_Model::getCleanInstance('Users');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('company_name', 'TestMulti sp. z o.o.');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected static $user;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function createUser(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$user = $recordModel;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = new \Settings_Roles_Record_Model();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('permissionsrelatedfield', 0)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('allowassignedrecordsto', 1);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::createRole();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testPrivilegeToDelete(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filePathDestination = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'storage' . \DIRECTORY_SEPARATOR . '0.jpg';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('logo', \App\Json::encode($attach));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($hash, $data[0]['key']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creating new role for test.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$role->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Line exceeds 120 characters; contains 171 characters Open
$filePath = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'tests' . \DIRECTORY_SEPARATOR . 'data' . \DIRECTORY_SEPARATOR . 'MultiImage' . \DIRECTORY_SEPARATOR . '0.jpg';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creating MultiCompany module record for tests.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function createRole(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('listrelatedrecord', 0)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('company', 1)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\copy($filePath, $filePathDestination);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'type' => $fileObj->getMimeType(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Temporary MultiCompany record object.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('first_name', 'Test');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$role = $recordModel;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Testing Reloaded by MultiCompany by image loading.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testReloadByMultiCompany(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($fileObj->getSize(), $data[0]['size']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = \Vtiger_Record_Model::getCleanInstance('MultiCompany');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('email1', 'mail@testowy.pl');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$hash = $fileObj->generateHash(true, $filePathDestination);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('confirm_password', 'Demo12345678T');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('companyid1', '23123214141412');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('previewrelatedrecord', 0)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('globalsearchadv', 1)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$recordMultiCompany->delete();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('rolename', 'TestMultiSelect');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$parentRole->addChildRole($recordModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$role->set('company', self::$recordMultiCompany->getId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
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())));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('changeowner', 1)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
\Users_Record_Model::deleteUserPermanently(self::$user->getId(), \Users_Record_Model::getCurrentUserModel()->getId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('auto_assign', 0)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertTrue(self::$recordMultiCompany->privilegeToDelete());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testNotPrivilegeToDelete(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'path' => $fileObj->getPath(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($multiCompanyLogo['name'], $data[0]['name']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Testing not privilege to delete.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected static $role;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('email1', 'testuser@yetiforce.com');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('roleid', self::$role->getId());
- Exclude checks
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';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'name' => '0.jpg',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Cleaning after tests.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var \Settings_Roles_Record_Model
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creating User module for tests.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function createMultiCompanyRecord(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('clendarallorecords', 3)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertFalse(self::$recordMultiCompany->privilegeToDelete());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModel = $recordModel->getField('logo');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('0.jpg', $data[0]['name']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\Users_Record_Model::deleteUserPermanently(self::$user->getId(), \Users_Record_Model::getCurrentUserModel()->getId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var \Vtiger_Record_Model
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('is_admin', 'on');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::createMultiCompanyRecord();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fileObj = \App\Fields\File::loadFromPath($filePathDestination);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'key' => $hash,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var \Vtiger_Record_Model
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Temporary Roles Settings record object.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('assigned_user_id', \App\User::getCurrentUserId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$parentRole = \Settings_Roles_Record_Model::getInstanceById($parentRoleId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Testing privilege to delete.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$attach[] = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function tearDownAfterClass(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('assignedmultiowner', 1)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$multiCompanyLogo = $userModel->get('multiCompanyLogo');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$role->delete(\Settings_Roles_Record_Model::getInstanceById('H1'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected static $recordMultiCompany;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('last_name', 'MultiCompany');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('user_password', 'Demo12345678T');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('editrelatedrecord', 0)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::createUser();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = self::$recordMultiCompany;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($multiCompanyLogo['key'], $data[0]['key']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$recordMultiCompany = $recordModel;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$parentRoleId = 'H1';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('searchunpriv', null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Setup data to tests.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function setUpBeforeClass(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$recordMultiCompany->clearPrivilegesCache();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'size' => $fileObj->getSize(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userModel = \App\User::getUserModel(self::$user->getId());
- Exclude checks
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())));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Class name "J_MultiCompany" is not in camel caps format Open
class J_MultiCompany extends \Tests\Base
- Exclude checks