File TextParser.php
has 538 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* TextParser test file.
*
* @package Tests
The class TextParser has 24 public methods. Consider refactoring TextParser to keep number of public methods under 10. Open
class TextParser extends \Tests\Base
{
/**
* Test record instance.
*
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class TextParser has 26 non-getter- and setter-methods. Consider refactoring TextParser to keep number of methods under 25. Open
class TextParser extends \Tests\Base
{
/**
* Test record instance.
*
- Read upRead up
- Exclude checks
TooManyMethods
Since: 0.1
A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
The default was changed from 10 to 25 in PHPMD 2.3.
Example
Source https://phpmd.org/rules/codesize.html#toomanymethods
TextParser
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class TextParser extends \Tests\Base
{
/**
* Test record instance.
*
Method testRecord
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testRecord()
{
$text = '+ $(record : NotExists)$ +';
$this->assertSame('+ +', self::$parserClean->setContent($text)->parse()->getContent(), 'Expected empty string');
Function testGetGeneralVariable
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function testGetGeneralVariable()
{
$arr = \App\TextParser::getInstance('IStorages')->getGeneralVariable();
$this->assertIsArray($arr, 'Expected array type');
$this->assertNotEmpty($arr, 'Expected any general variables data');
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method testEmployee
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testEmployee()
{
$currentUser = \App\User::getCurrentUserId();
$userName = 'Employee';
$userExistsId = (new \App\Db\Query())->select(['id'])->from('vtiger_users')->where(['user_name' => $userName])
Method testDate
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testDate()
{
$this->assertSame('+ ' . \date('Y-m-d') . ' +', self::$parserClean
->setContent('+ $(date : now)$ +')
->parse()
Function testGetSourceVariable
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function testGetSourceVariable()
{
$this->assertFalse(\App\TextParser::getInstance('Leads')->setSourceRecord(self::$recordLeads->getId())->getSourceVariable(), 'TextParser::getSourceVariable() should return false for Leads module');
$arr = \App\TextParser::getInstance('Campaigns')->setSourceRecord(self::$recordLeads->getId())->getSourceVariable();
$this->assertIsArray($arr, 'Expected array type');
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method testRelatedRecordsList
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testRelatedRecordsList()
{
$text = '$(relatedRecordsList : Accounts|lead_no,lastname,phone,description|[[["company","a","Test"]]]|All|5)$';
$result = \App\TextParser::getInstanceByModel(self::$recordLeads)
->setContent($text)
Method testGeneral
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testGeneral()
{
$this->assertSame('+ ' . (new \DateTimeField(null))->getDisplayDate() . ' +', self::$parserClean
->setContent('+ $(general : CurrentDate)$ +')
->parse()
Method testTranslate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testTranslate()
{
$this->assertSame(
'+$(general : CurrentDate)$ | ' . \App\Language::translate('LBL_SECONDS') . '==' . \App\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',
self::$parserClean->setContent('+$(general : CurrentDate)$ | $(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parseTranslations()->getContent(),
Function testGetRelatedVariable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function testGetRelatedVariable()
{
$arr = self::$parserCleanModule->getRelatedVariable();
$this->assertIsArray($arr, 'Expected array type');
$this->assertNotEmpty($arr, 'Expected any related variables data');
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Class "TextParser" has 26 methods, which is greater than 20 authorized. Split it into smaller classes. Open
class TextParser extends \Tests\Base
- Read upRead up
- Exclude checks
A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.
Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed. Open
public function testGetGeneralVariable()
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Missing class import via use statement (line '273', column '28'). Open
$employeeExistsId = (new \App\Db\Query())
- 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
Missing class import via use statement (line '231', column '154'). Open
\App\User::setCurrentUserId((new \App\Db\Query())->select(['id'])->from('vtiger_users')->where(['status' => 'Active'])->andWhere(['not in', 'id', (new \App\Db\Query())->select(['smownerid'])->from('vtiger_crmentity')->where(['deleted' => 0, 'setype' => 'OSSEmployees'])
- 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
Missing class import via use statement (line '258', column '24'). Open
$userExistsId = (new \App\Db\Query())->select(['id'])->from('vtiger_users')->where(['user_name' => $userName])
- 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
Missing class import via use statement (line '125', column '33'). Open
$this->assertSame('+ ' . (new \DateTimeField(null))->getDisplayDate() . ' +', self::$parserClean
- 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
Missing class import via use statement (line '231', column '36'). Open
\App\User::setCurrentUserId((new \App\Db\Query())->select(['id'])->from('vtiger_users')->where(['status' => 'Active'])->andWhere(['not in', 'id', (new \App\Db\Query())->select(['smownerid'])->from('vtiger_crmentity')->where(['deleted' => 0, 'setype' => 'OSSEmployees'])
- 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\TextParser' in method 'testStaticMethods'. Open
$this->assertSame(1, \App\TextParser::isVaribleToParse('$(TestGroup : TestVar)$'), 'string should be parseable');
- 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 'testBasicField'. Open
$tmpUser = \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\Cache' in method 'testEmployee'. Open
\App\Cache::clear();
- 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 '\Tests\Base\C_RecordActions' in method 'testRelatedRecordsList'. Open
$contactModel = \Tests\Base\C_RecordActions::createContactRecord();
- 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 'testEmployee'. Open
$employeeModel = $employeeExistsId ? \Vtiger_Record_Model::getInstanceById($employeeExistsId, 'OSSEmployees') : \Vtiger_Record_Model::getCleanInstance('OSSEmployees');
- 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 '\Tests\Base\C_RecordActions' in method 'testInstancesCreation'. Open
self::$recordLeads = $recordModel = \Tests\Base\C_RecordActions::createLeadRecord(false);
- 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\TextParser' in method 'testGetRelatedListVariable'. Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($option['key']), 'Option: ' . $option['label'] . ', value: ' . $option['key'] . ' should be parseable');
- 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\TextParser' in method 'testInstancesCreation'. Open
self::$parserCleanModule = \App\TextParser::getInstance('Leads');
- 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\Cache' in method 'testBasicField'. Open
\App\Cache::clear();
- 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 'testEmployee'. Open
\App\User::setCurrentUserId($currentUser);
- 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 'testEmployee'. Open
$employeeUser = $userExistsId ? \Vtiger_Record_Model::getInstanceById($userExistsId, 'Users') : \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 '\Tests\Base\C_RecordActions' in method 'testRelatedRecordsList'. Open
$accountModel = \Tests\Base\C_RecordActions::createAccountRecord();
- 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_Util_Helper' in method 'createInventory'. Open
}
- 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 '\Tests\Base\C_RecordActions' in method 'testRelatedRecordsList'. Open
$result = \App\TextParser::getInstanceByModel(\Tests\Base\C_RecordActions::createAccountRecord())->withoutTranslations(true)
- 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\Config' in method 'testGeneral'. Open
$this->assertSame('+ ' . \App\Config::main('PORTAL_URL') . ' +', self::$parserClean
- 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_Util_Helper' in method 'testGeneral'. Open
$this->assertSame('+ ' . \Vtiger_Util_Helper::convertTimeIntoUsersDisplayFormat(date('H:i:s')) . ' +', self::$parserClean
- 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\TextParser' in method 'testInstancesCreation'. Open
$this->assertInstanceOf('\App\TextParser', \App\TextParser::getInstanceById($recordModel->getId(), 'Leads'), 'Expected instance from lead id and module string of \App\TextParser');
- 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 'testEmployee'. Open
\App\User::setCurrentUserId($employeeUser->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\TextParser' in method 'testInstancesCreation'. Open
self::$parserClean = \App\TextParser::getInstance();
- 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\Config' in method 'testGeneral'. Open
$this->assertSame('+ ' . \App\Config::main('site_URL') . ' +', self::$parserClean
- 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\Config' in method 'testGeneral'. Open
'+ ' . (empty($defaultTimeZone = date_default_timezone_get()) ? \App\Config::main('default_timezone') : $defaultTimeZone) . ' +',
- 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 'testGeneral'. Open
$user = \App\User::getCurrentUserModel();
- 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\Config' in method 'testGeneral'. Open
'+ ' . ($user->getDetail('time_zone') ?: \App\Config::main('default_timezone')) . ' +',
- 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 'testBasicField'. Open
\App\User::setCurrentUserId($tmpUser);
- 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 'testBasicField'. Open
\App\User::setCurrentUserId((new \App\Db\Query())->select(['id'])->from('vtiger_users')->where(['status' => 'Active'])->andWhere(['not in', 'id', (new \App\Db\Query())->select(['smownerid'])->from('vtiger_crmentity')->where(['deleted' => 0, 'setype' => 'OSSEmployees'])
->column(), ])
->scalar());
- 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\TextParser' in method 'testGetBaseListVariable'. Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($option['key']), 'Option: ' . $option['label'] . ', value: ' . $option['key'] . ' should be parseable');
- 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\TextParser' in method 'testStaticMethods'. Open
$this->assertSame(0, \App\TextParser::isVaribleToParse('$X(TestGroup : TestVar)$'), 'string should be not parseable');
- 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 'testEmployee'. Open
$employeeUser = $userExistsId ? \Vtiger_Record_Model::getInstanceById($userExistsId, 'Users') : \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 'testEmployee'. Open
$employeeModel = $employeeExistsId ? \Vtiger_Record_Model::getInstanceById($employeeExistsId, 'OSSEmployees') : \Vtiger_Record_Model::getCleanInstance('OSSEmployees');
- 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\TextParser' in method 'testInstancesCreation'. Open
self::$parserRecord = \App\TextParser::getInstanceByModel($recordModel);
- 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 'testEmployee'. Open
$currentUser = \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\Language' in method 'testTranslate'. Open
'+$(general : CurrentDate)$ | ' . \App\Language::translate('LBL_SECONDS') . '==' . \App\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',
- 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\TextParser' in method 'testGetRelatedVariable'. Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_label']), 'Option: ' . $element['label'] . ', value: ' . $element['var_label'] . ' should be parseable in group: ' . $group);
- 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\TextParser' in method 'testGetGeneralVariable'. Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($item), 'Option: ' . $translation . ', value: ' . $item . ' should be parseable in group: ' . $groupName);
- 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 'createProduct'. Open
self::$product = \Vtiger_Record_Model::getCleanInstance('Products');
- 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 '\Tests\Base\C_RecordActions' in method 'testRelatedRecord'. Open
$this->assertNotSame('+ +', '+ ' . \App\TextParser::getInstanceByModel(\Tests\Base\C_RecordActions::createContactRecord())->setContent('+$(relatedRecord : parent_id|accountname)$+')->parse()->getContent() . ' +', 'Account name should be not empty(without module)');
- 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 '\Tests\Base\C_RecordActions' in method 'testRelatedRecord'. Open
$this->assertNotSame('+ +', '+ ' . \App\TextParser::getInstanceByModel(\Tests\Base\C_RecordActions::createContactRecord())->setContent('+$(relatedRecord : parent_id|accountname|Accounts)$+')->parse()->getContent() . ' +', 'Account name should be not empty');
- 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 'testRelatedRecord'. Open
$comment = \Vtiger_Record_Model::getCleanInstance('ModComments');
- 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\Language' in method 'testTranslate'. Open
'+' . \App\Language::translate('LBL_SECONDS') . '==' . \App\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',
- 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 'testAmountToReturn'. Open
$correctingInvoiceModel->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\TextParser' in method 'testGetRelatedVariable'. Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_value']), 'Option: ' . $element['label'] . ', value: ' . $element['var_value'] . ' should be parseable in group: ' . $group);
- 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\Config' in method 'testRecord'. Open
$this->assertSame('+ ' . \App\Config::main('site_URL') . 'index.php?module=Leads&view=Detail&record=' . self::$recordLeads->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\Language' in method 'testTranslate'. Open
'+' . \App\Language::translate('LBL_SECONDS') . '==' . \App\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',
- 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\Language' in method 'testTranslate'. Open
'+' . \App\Language::translate('LBL_SECONDS') . '==' . \App\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',
- 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\TextParser' in method 'testGetRecordVariable'. Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_value']), 'Option: ' . $element['label'] . ', value: ' . $element['var_value'] . ' should be parseable in group: ' . $group);
- 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\TextParser' in method 'testGetRecordVariable'. Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_label']), 'Option: ' . $element['label'] . ', value: ' . $element['var_label'] . ' should be parseable in group: ' . $group);
- 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\TextParser' in method 'testGetSourceVariable'. Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($data['var_label']), 'Option: ' . $data['label'] . ', value: ' . $data['var_label'] . ' should be parseable in group: ' . $group);
- 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
The method testGetGeneralVariable uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$placeholders = \explode(', ', $placeholder);
$this->assertIsArray($placeholders, 'Expected array type in group: ' . $groupName);
$this->assertNotEmpty($placeholders, 'Expected any group data in group: ' . $groupName);
foreach ($placeholders as $item) {
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\App\Config' in method 'testRecord'. Open
$this->assertSame('+ ' . \App\Config::main('PORTAL_URL') . '/index.php?module=Leads&action=index&id=' . self::$recordLeads->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 '\Vtiger_Record_Model' in method 'testAmountToReturn'. Open
$correctingInvoiceModel = \Vtiger_Record_Model::getCleanInstance('FCorectingInvoice');
- 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\TextParser' in method 'testGetSourceVariable'. Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($data['var_value']), 'Option: ' . $data['label'] . ', value: ' . $data['var_value'] . ' should be parseable in group: ' . $group);
- 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
The method testGetSourceVariable uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
foreach ($data as $element) {
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_value']), 'Option: ' . $element['label'] . ', value: ' . $element['var_value'] . ' should be parseable in group: ' . $group);
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_label']), 'Option: ' . $element['label'] . ', value: ' . $element['var_label'] . ' should be parseable in group: ' . $group);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\App\User' in method 'testAmountToReturn'. Open
$invoiceModel->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\TextParser' in method 'testGetSourceVariable'. Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_value']), 'Option: ' . $element['label'] . ', value: ' . $element['var_value'] . ' should be parseable in group: ' . $group);
- 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 'testRecord'. Open
$comment = \Vtiger_Record_Model::getCleanInstance('ModComments');
- 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\Language' in method 'testTranslate'. Open
'+$(general : CurrentDate)$ | ' . \App\Language::translate('LBL_SECONDS') . '==' . \App\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',
- 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\Language' in method 'testTranslate'. Open
'+' . \App\Language::translate('LBL_SECONDS') . '==' . \App\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',
- 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\TextParser' in method 'testGetGeneralVariable'. Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($placeholder), 'Option: ' . $translation . ', value: ' . $placeholder . ' should be parseable in group: ' . $groupName);
- 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 'testAmountToReturn'. Open
$invoiceModel = \Vtiger_Record_Model::getCleanInstance('FInvoice');
- 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\Language' in method 'testTranslate'. Open
'+$(general : CurrentDate)$ | ' . \App\Language::translate('LBL_SECONDS') . '==' . \App\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',
- 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\Language' in method 'testTranslate'. Open
'+$(general : CurrentDate)$ | ' . \App\Language::translate('LBL_SECONDS') . '==' . \App\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',
- 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\TextParser' in method 'testGetSourceVariable'. Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_label']), 'Option: ' . $element['label'] . ', value: ' . $element['var_label'] . ' should be parseable in group: ' . $group);
- 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 " should be parseable in group: " 10 times. Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_value']), 'Option: ' . $element['label'] . ', value: ' . $element['var_value'] . ' should be parseable in group: ' . $group);
- 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.
Define a constant instead of duplicating this literal "LBL_COPY_BILLING_ADDRESS" 4 times. Open
'+$(general : CurrentDate)$ | ' . \App\Language::translate('LBL_SECONDS') . '==' . \App\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',
- 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.
Define a constant instead of duplicating this literal "Record instance: Translations should be equal" 3 times. Open
'Record instance: Translations should be equal');
- 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.
Define a constant instead of duplicating this literal "Clean instance: Translations should be equal" 3 times. Open
'Clean instance: Translations should be equal');
- 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.
Define a constant instead of duplicating this literal "+ $(record : ChangesListChanges)$ +" 4 times. Open
$text = '+ $(record : ChangesListChanges)$ +';
- 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.
Define a constant instead of duplicating this literal "+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+" 6 times. Open
self::$parserClean->setContent('+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parse()->getContent(),
- 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.
Define a constant instead of duplicating this literal "Accounts" 4 times. Open
'+$(general : CurrentDate)$ | ' . \App\Language::translate('LBL_SECONDS') . '==' . \App\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',
- 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.
Define a constant instead of duplicating this literal "Leads" 3 times. Open
self::$parserCleanModule = \App\TextParser::getInstance('Leads');
- 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.
Define a constant instead of duplicating this literal "Expected any related variables data" 8 times. Open
$this->assertNotEmpty($arr, 'Expected any related variables data');
- 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.
Define a constant instead of duplicating this literal "ModComments" 3 times. Open
$comment = \Vtiger_Record_Model::getCleanInstance('ModComments');
- 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.
Define a constant instead of duplicating this literal "Option: " 12 times. Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($option['key']), 'Option: ' . $option['label'] . ', value: ' . $option['key'] . ' should be parseable');
- 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.
Define a constant instead of duplicating this literal "Expected array type" 11 times. Open
$this->assertIsArray($arr, 'Expected array type');
- 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.
Define a constant instead of duplicating this literal ", value: " 12 times. Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($option['key']), 'Option: ' . $option['label'] . ', value: ' . $option['key'] . ' should be parseable');
- 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.
Define a constant instead of duplicating this literal "var_label" 8 times. Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_label']), 'Option: ' . $element['label'] . ', value: ' . $element['var_label'] . ' should be parseable in group: ' . $group);
- 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.
Define a constant instead of duplicating this literal "OSSEmployees" 6 times. Open
\App\User::setCurrentUserId((new \App\Db\Query())->select(['id'])->from('vtiger_users')->where(['status' => 'Active'])->andWhere(['not in', 'id', (new \App\Db\Query())->select(['smownerid'])->from('vtiger_crmentity')->where(['deleted' => 0, 'setype' => 'OSSEmployees'])
- 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.
Define a constant instead of duplicating this literal "assigned_user_id" 3 times. Open
$employeeModel->set('assigned_user_id', $employeeUser->getId());
- 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.
Define a constant instead of duplicating this literal "Y-m-d" 8 times. Open
$this->assertSame('+ ' . \date('Y-m-d') . ' +', self::$parserClean
- 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.
Define a constant instead of duplicating this literal "var_value" 9 times. Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_value']), 'Option: ' . $element['label'] . ', value: ' . $element['var_value'] . ' should be parseable in group: ' . $group);
- 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.
Define a constant instead of duplicating this literal "\App\TextParser" 4 times. Open
$this->assertInstanceOf('\App\TextParser', self::$parserClean, 'Expected clean instance without module of \App\TextParser');
- 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.
Define a constant instead of duplicating this literal "LBL_SECONDS" 4 times. Open
'+$(general : CurrentDate)$ | ' . \App\Language::translate('LBL_SECONDS') . '==' . \App\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',
- 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.
Define a constant instead of duplicating this literal "label" 10 times. Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($option['key']), 'Option: ' . $option['label'] . ', value: ' . $option['key'] . ' should be parseable');
- 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.
Avoid unused local variables such as '$key'. Open
foreach ($arr as $key => $content) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$key'. Open
foreach ($data as $key => $element) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$key'. Open
foreach ($arr as $key => $content) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Call to method getInstanceById
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertInstanceOf('\App\TextParser', \App\TextParser::getInstanceById($recordModel->getId(), 'Leads'), 'Expected instance from lead id and module string of \App\TextParser');
- Exclude checks
Call to method getBaseListVariable
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$arr = self::$parserClean->getBaseListVariable();
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ ' . \App\Config::main('PORTAL_URL') . ' +', self::$parserClean
- Exclude checks
Call to method getInstance
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserCleanModule = \App\TextParser::getInstance('Leads');
- Exclude checks
Call to method getRelatedListVariable
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$arr = self::$parserCleanModule->getRelatedListVariable();
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ ' . \App\Config::main('site_URL') . ' +', self::$parserClean
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertInstanceOf
Open
$this->assertInstanceOf('\App\TextParser', self::$parserClean, 'Expected clean instance without module of \App\TextParser');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($option['key']), 'Option: ' . $option['label'] . ', value: ' . $option['key'] . ' should be parseable');
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserClean->setContent('+ $(general : UserTimeZone)$ +')->parse()->getContent(),
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($option['key']), 'Option: ' . $option['label'] . ', value: ' . $option['key'] . ' should be parseable');
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ ' . (new \DateTimeField(null))->getDisplayDate() . ' +', self::$parserClean
- Exclude checks
Call to method isVaribleToParse
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($option['key']), 'Option: ' . $option['label'] . ', value: ' . $option['key'] . ' should be parseable');
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ ' . \Vtiger_Util_Helper::convertTimeIntoUsersDisplayFormat(date('H:i:s')) . ' +', self::$parserClean
- Exclude checks
Call to method isVaribleToParse
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame(0, \App\TextParser::isVaribleToParse('$X(TestGroup : TestVar)$'), 'string should be not parseable');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertInstanceOf
Open
$this->assertInstanceOf('\App\TextParser', self::$parserCleanModule, 'Expected clean instance with module Leads of \App\TextParser');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(1, \App\TextParser::isVaribleToParse('$(TestGroup : TestVar)$'), 'string should be parseable');
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ ' . \App\Config::main('site_URL') . ' +', self::$parserClean
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotEmpty
Open
$this->assertNotEmpty($arr, 'Expected any related list data');
- Exclude checks
Call to method isVaribleToParse
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame(1, \App\TextParser::isVaribleToParse('$(TestGroup : TestVar)$'), 'string should be parseable');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ +', self::$parserClean
- Exclude checks
Property \Tests\App\TextParser::$parserRecord
has undeclared type \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
private static $parserRecord;
- Exclude checks
Call to method getInstance
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserClean = \App\TextParser::getInstance();
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('', self::$parserClean
- Exclude checks
Property \Tests\App\TextParser::$parserCleanModule
has undeclared type \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
private static $parserCleanModule;
- Exclude checks
Call to method isVaribleToParse
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($option['key']), 'Option: ' . $option['label'] . ', value: ' . $option['key'] . ' should be parseable');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(0, \App\TextParser::isVaribleToParse('$X(TestGroup : TestVar)$'), 'string should be not parseable');
- Exclude checks
Argument 1 (value)
is null
but \DateTimeField::__construct()
takes \type
defined at /code/include/fields/DateTimeField.php:31
Open
$this->assertSame('+ ' . (new \DateTimeField(null))->getDisplayDate() . ' +', self::$parserClean
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertInstanceOf
Open
$this->assertInstanceOf('\App\TextParser', \App\TextParser::getInstanceById($recordModel->getId(), 'Leads'), 'Expected instance from lead id and module string of \App\TextParser');
- Exclude checks
Call to method getInstanceByModel
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserRecord = \App\TextParser::getInstanceByModel($recordModel);
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserClean->setContent('+ $(general : BaseTimeZone)$ +')->parse()->getContent(),
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ ' . \App\Config::main('PORTAL_URL') . ' +', self::$parserClean
- Exclude checks
Property \Tests\App\TextParser::$parserClean
has undeclared type \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
private static $parserClean;
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertIsArray
Open
$this->assertIsArray($arr, 'Expected array type');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(
- Exclude checks
Call to method getCurrentUserModel
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$user = \App\User::getCurrentUserModel();
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertInstanceOf
Open
$this->assertInstanceOf('\App\TextParser', self::$parserRecord, 'Expected instance from record model of \App\TextParser');
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('', self::$parserClean
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ +', self::$parserClean
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ ' . \Vtiger_Util_Helper::convertTimeIntoUsersDisplayFormat(date('H:i:s')) . ' +', self::$parserClean
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertIsArray
Open
$this->assertIsArray($arr, 'Expected array type');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotEmpty
Open
$this->assertNotEmpty($arr, 'Expected any related list data');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ ' . (new \DateTimeField(null))->getDisplayDate() . ' +', self::$parserClean
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ PlaceholderNotExist +', self::$parserClean
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ ' . \date('Y-m-d', \strtotime('monday this week')) . ' +', self::$parserClean
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ ' . \date('Y-m-d', \strtotime('first day of this month')) . ' +', self::$parserClean
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ ' . \date('Y-m-d', \strtotime('first day of this month')) . ' +', self::$parserClean
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotEmpty
Open
$this->assertNotEmpty($employeeUser->getId(), 'New user id should be not empty');
- Exclude checks
Call to method setCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
\App\User::setCurrentUserId($currentUser);
- Exclude checks
Call to method getInstance
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ +', \App\TextParser::getInstance()
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ +', \App\TextParser::getInstance()
- Exclude checks
Call to method getInstance
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ +', \App\TextParser::getInstance()
- Exclude checks
Call to method getInstance
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ +', \App\TextParser::getInstance()
- Exclude checks
Call to method withoutTranslations
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserRecord->withoutTranslations(false);
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ TestComment +', self::$parserRecord->setContent($text)
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertIsArray
Open
$this->assertIsArray($arr, 'Expected (cached) array type');
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ ' . \date('Y-m-d', \strtotime('monday next week')) . ' +', self::$parserClean
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ test +', self::$parserClean
- Exclude checks
Call to method getCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$currentUser = \App\User::getCurrentUserId();
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ +', self::$parserRecord->setContent($text)->parse()->getContent());
- Exclude checks
Call to method withoutTranslations
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserRecord->withoutTranslations(true);
- Exclude checks
Call to method withoutTranslations
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserClean->withoutTranslations(false);
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotEmpty
Open
$this->assertNotEmpty($content, 'Expected any related variables data');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotEmpty
Open
$this->assertNotEmpty($result, 'relatedRecordsList should return not empty string if related records found');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ +', \App\TextParser::getInstance()
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserRecord->setContent($text)->parse()->getContent(), 'Expected url is different');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertStringContainsString
Open
$this->assertStringContainsString('test', self::$parserRecord->setContent($text)->parse()->getContent(), 'Test record changes list should should contain vat_id info');
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertStringContainsString('test', self::$parserRecord->setContent($text)->parse()->getContent(), 'Test record changes list should should contain vat_id info');
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertStringContainsString('testing', self::$parserRecord->setContent($text)->parse()->getContent(), 'Test record changes list values should be not empty');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ ' . self::$recordLeads->get('company') . ' +', self::$parserRecord->setContent($text)->parse()->getContent(), 'Test record company should be same as in db');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserRecord->setContent('+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parse()->getContent(),
- Exclude checks
Call to method withoutTranslations
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserRecord->withoutTranslations(false);
- Exclude checks
Call to method getRecordVariable
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$arr = self::$parserCleanModule->getRecordVariable();
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotEmpty
Open
$this->assertNotEmpty($arr, 'Expected any related variables data');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_label']), 'Option: ' . $element['label'] . ', value: ' . $element['var_label'] . ' should be parseable in group: ' . $group);
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotEmpty
Open
$this->assertNotEmpty($data, 'Expected any related variables data');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ PlaceholderNotExist +', self::$parserClean
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ ' . \date('Y-m-d') . ' +', self::$parserClean
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ ' . \date('Y-m-d', \strtotime('first day of next month')) . ' +', self::$parserClean
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ +', self::$parserClean
- Exclude checks
Call to method getParam
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertNull(self::$parserClean->getParam('test_var_not_exist'), 'Clean instance: key not exist, getParam should return false');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ +', self::$parserRecord
- Exclude checks
Call to method getInstanceByModel
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$result = \App\TextParser::getInstanceByModel(self::$recordLeads)->withoutTranslations(true)
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ ' . self::$recordLeads->getId() . ' +', self::$parserRecord->setContent($text)->parse()->getContent(), 'Expected record id is different');
- Exclude checks
Call to method withoutTranslations
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserRecord->withoutTranslations(false);
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ +', self::$parserRecord->setContent($text)
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserRecord->setContent('+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parse()->getContent(),
- Exclude checks
Call to method getCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$tmpUser = \App\User::getCurrentUserId();
- Exclude checks
Call to method setCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
\App\User::setCurrentUserId((new \App\Db\Query())->select(['id'])->from('vtiger_users')->where(['status' => 'Active'])->andWhere(['not in', 'id', (new \App\Db\Query())->select(['smownerid'])->from('vtiger_crmentity')->where(['deleted' => 0, 'setype' => 'OSSEmployees'])
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ +', self::$parserClean
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertEmpty
Open
$this->assertEmpty($result, 'relatedRecordsList should return empty string if no related records found');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ +', self::$parserClean->setContent($text)->parse()->getContent(), 'Expected empty string');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ ' . \date('Y-m-d', \strtotime('last day of this month')) . ' +', self::$parserClean
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
\App\User::setCurrentUserId((new \App\Db\Query())->select(['id'])->from('vtiger_users')->where(['status' => 'Active'])->andWhere(['not in', 'id', (new \App\Db\Query())->select(['smownerid'])->from('vtiger_crmentity')->where(['deleted' => 0, 'setype' => 'OSSEmployees'])
- Exclude checks
Call to method getInstance
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ +', \App\TextParser::getInstance()
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ ' . self::$recordLeads->getId() . ' +', self::$parserRecord->setContent($text)->parse()->getContent(), 'Expected record id is different');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ ' . self::$recordLeads->getName() . ' +', self::$parserRecord->setContent($text)->parse()->getContent(), 'Expected record label is different');
- Exclude checks
Call to method isVaribleToParse
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_value']), 'Option: ' . $element['label'] . ', value: ' . $element['var_value'] . ' should be parseable in group: ' . $group);
- Exclude checks
Call to method isVaribleToParse
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($data['var_value']), 'Option: ' . $data['label'] . ', value: ' . $data['var_value'] . ' should be parseable in group: ' . $group);
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ ' . \date('Y-m-d', \strtotime('+1 day')) . ' +', self::$parserClean
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ +', self::$parserClean
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotFalse
Open
$this->assertNotFalse(strpos($result, 'records-list'), 'Record list should contain html class recordsList');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ Leads +', self::$parserRecord->setContent($text)->parse()->getContent(), 'Expected module name is different');
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ +', self::$parserRecord->setContent($text)->parse()->getContent());
- Exclude checks
Call to method withoutTranslations
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserRecord->withoutTranslations(true);
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserClean->setContent('+$(general : CurrentDate)$ | $(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parseTranslations()->getContent(),
- Exclude checks
Call to method withoutTranslations
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserRecord->withoutTranslations(true);
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ ' . \date('Y-m-d', \strtotime('monday this week')) . ' +', self::$parserClean
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ test +', self::$parserClean
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ +', self::$parserClean
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$userExistsId = (new \App\Db\Query())->select(['id'])->from('vtiger_users')->where(['user_name' => $userName])
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotEmpty
Open
$this->assertNotEmpty($result, 'recordsList should return not empty string(CustomView not exists)');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertEmpty
Open
$this->assertEmpty($result, 'relatedRecordsList should return empty string if no related records found(CustomView not exists)');
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('Mail podstawowy: test3@yetiforce.com<br>', self::$parserRecord->setContent($text)->parse()->getContent());
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ $(translate : Leads|Email)$: test3@yetiforce.com<br> +', self::$parserRecord->setContent($text)->parse()->getContent());
- Exclude checks
Call to method withoutTranslations
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserRecord->withoutTranslations(false);
- Exclude checks
Call to method setLanguage
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserClean->setLanguage('pl-PL')->setContent('+$(general : CurrentDate)$ | $(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parseTranslations()->getContent(),
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertIsArray
Open
$this->assertIsArray($data, 'Expected array type');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ ' . \date('Y-m-d', \strtotime('+1 day')) . ' +', self::$parserClean
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$employeeExistsId = (new \App\Db\Query())
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotEmpty
Open
$this->assertNotEmpty($result, 'recordsList should return not empty string');
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertStringContainsString('test', self::$parserRecord->setContent($text)->parse()->getContent(), 'Test record changes list should should contain vat_id info');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertIsArray
Open
$this->assertIsArray($arr, 'Expected array type');
- Exclude checks
Call to method getRecordVariable
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$arr = self::$parserCleanModule->getRecordVariable();
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ ' . \date('Y-m-d', \strtotime('first day of next month')) . ' +', self::$parserClean
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertIsArray
Open
$this->assertIsArray($arr, 'Expected array type');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(
- Exclude checks
Call to method getInstance
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
\App\TextParser::getInstance()
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotFalse
Open
$this->assertNotFalse(\strpos($result, $contactModel->get('firstname')), 'relatedRecordsList should contain test record row');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ +', self::$parserRecord->setContent($text)->parse()->getContent());
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('Mail podstawowy: test3@yetiforce.com<br>', self::$parserRecord->setContent($text)->parse()->getContent());
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ ' . self::$recordLeads->get('company') . ' +', self::$parserRecord->setContent($text)->parse()->getContent(), 'Test record company should be same as in db');
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserClean->setContent('+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parse()->getContent(),
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotEmpty
Open
$this->assertNotEmpty($arr, 'Expected any (cached) related variables data');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotEmpty
Open
$this->assertNotEmpty($arr, 'Expected any related variables data');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ ' . \date('Y-m-d') . ' +', self::$parserClean
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ ' . \date('Y-m-d', \strtotime('last day of this month')) . ' +', self::$parserClean
- Exclude checks
Call to method getParam
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('test', self::$parserClean->getParam('test_var'), 'Clean instance: getParam should return value test');
- Exclude checks
Call to method setCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
\App\User::setCurrentUserId($tmpUser);
- Exclude checks
Call to method getInstanceByModel
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$result = \App\TextParser::getInstanceByModel(self::$recordLeads)
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ ' . \App\Config::main('site_URL') . 'index.php?module=Leads&view=Detail&record=' . self::$recordLeads->getId() . ' +',
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ +', self::$parserRecord->setContent($text)->parse()->getContent());
- Exclude checks
Reference to instance property recordModel
from undeclared class \App\TextParser
Open
self::$parserRecord->recordModel->set('email', 'test3@yetiforce.com')->save();
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ $(translate : Leads|Email)$: test3@yetiforce.com<br> +', self::$parserRecord->setContent($text)->parse()->getContent());
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ +', self::$parserRecord->setContent($text)
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertIsArray
Open
$this->assertIsArray($data, 'Expected array type');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ ' . \date('Y-m-d', \strtotime('monday next week')) . ' +', self::$parserClean
- Exclude checks
Call to method setParams
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserClean->setParams(['test_var' => 'test']);
- Exclude checks
Call to method setCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
\App\User::setCurrentUserId($employeeUser->getId());
- Exclude checks
Call to method getInstance
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$result = \App\TextParser::getInstance()
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotEmpty
Open
$this->assertNotEmpty($result, 'relatedRecordsList should return not empty string if related records found');
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ +', self::$parserClean->setContent($text)->parse()->getContent(), 'Expected empty string');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ ' . \App\Config::main('PORTAL_URL') . '/index.php?module=Leads&action=index&id=' . self::$recordLeads->getId() . ' +',
- Exclude checks
Call to method getInstance
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertFalse(\App\TextParser::getInstance('Leads')->setSourceRecord(self::$recordLeads->getId())->getSourceVariable(), 'TextParser::getSourceVariable() should return false for Leads module');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertFalse
Open
$this->assertFalse(\App\TextParser::getInstance('Leads')->setSourceRecord(self::$recordLeads->getId())->getSourceVariable(), 'TextParser::getSourceVariable() should return false for Leads module');
- Exclude checks
Call to method getInstance
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$arr = \App\TextParser::getInstance('Campaigns')->setSourceRecord(self::$recordLeads->getId())->getSourceVariable();
- Exclude checks
Call to method getInstance
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$result = \App\TextParser::getInstance()->withoutTranslations(true)
- Exclude checks
Call to method getInstanceByModel
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$result = \App\TextParser::getInstanceByModel($accountModel)->withoutTranslations(true)
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNull
Open
$this->assertNull(self::$parserClean->getParam('test_var_not_exist'), 'Clean instance: key not exist, getParam should return false');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotFalse
Open
$this->assertNotFalse(\strpos($result, $contactModel->get('firstname')), 'relatedRecordsList should contain test record row');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ +', \App\TextParser::getInstance()
- Exclude checks
Call to method getInstanceByModel
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$result = \App\TextParser::getInstanceByModel(\Tests\Base\C_RecordActions::createAccountRecord())->withoutTranslations(true)
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserRecord->setContent($text)->parse()->getContent(), 'Expected url is different');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ +', \App\TextParser::getInstance()
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertStringContainsString
Open
$this->assertStringContainsString('test', self::$parserRecord->setContent($text)->parse()->getContent(), 'Test record changes list should should contain vat_id info');
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ Leads +', self::$parserRecord->setContent($text)->parse()->getContent(), 'Expected module name is different');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ ' . self::$recordLeads->getName() . ' +', self::$parserRecord->setContent($text)->parse()->getContent(), 'Expected record label is different');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_value']), 'Option: ' . $element['label'] . ', value: ' . $element['var_value'] . ' should be parseable in group: ' . $group);
- Exclude checks
Call to method withoutTranslations
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserRecord->withoutTranslations(true);
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertIsArray
Open
$this->assertIsArray($content, 'Expected array type');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertStringContainsString
Open
$this->assertStringContainsString('testing', self::$parserRecord->setContent($text)->parse()->getContent(), 'Test record changes list values should be not empty');
- Exclude checks
Call to method isVaribleToParse
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($data['var_label']), 'Option: ' . $data['label'] . ', value: ' . $data['var_label'] . ' should be parseable in group: ' . $group);
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserClean->setContent('+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parse()->getContent(),
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotEmpty
Open
$this->assertNotEmpty($data, 'Expected any related variables data');
- Exclude checks
Call to method isVaribleToParse
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_label']), 'Option: ' . $element['label'] . ', value: ' . $element['var_label'] . ' should be parseable in group: ' . $group);
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($data['var_value']), 'Option: ' . $data['label'] . ', value: ' . $data['var_value'] . ' should be parseable in group: ' . $group);
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(4, \substr_count($result, '<th '), 'Columns count should be equal to provided list');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ TestComment +', self::$parserRecord->setContent($text)
- Exclude checks
Call to method withoutTranslations
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserClean->withoutTranslations(true);
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ ' . \date('Y-m-d', \strtotime('-1 day')) . ' +', self::$parserClean
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('+ ' . \date('Y-m-d', \strtotime('-1 day')) . ' +', self::$parserClean
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ +', self::$parserClean
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('test', self::$parserClean->getParam('test_var'), 'Clean instance: getParam should return value test');
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ +', self::$parserClean
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('+ +', self::$parserRecord
- Exclude checks
Call to method getInstance
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
\App\TextParser::getInstance()
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(
- Exclude checks
Call to method isVaribleToParse
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_value']), 'Option: ' . $element['label'] . ', value: ' . $element['var_value'] . ' should be parseable in group: ' . $group);
- Exclude checks
Call to method isVaribleToParse
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_label']), 'Option: ' . $element['label'] . ', value: ' . $element['var_label'] . ' should be parseable in group: ' . $group);
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($placeholder), 'Option: ' . $translation . ', value: ' . $placeholder . ' should be parseable in group: ' . $groupName);
- Exclude checks
Call to method getInstanceByModel
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertNotSame('+ +', '+ ' . \App\TextParser::getInstanceByModel(\Tests\Base\C_RecordActions::createContactRecord())->setContent('+$(relatedRecord : parent_id|accountname|Accounts)$+')->parse()->getContent() . ' +', 'Account name should be not empty');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotEmpty
Open
$this->assertNotEmpty($placeholders, 'Expected any group data in group: ' . $groupName);
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
'+ +', self::$parserClean->setContent('+ $(sourceRecord : description)$ +')->parse()->getContent(),
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotSame
Open
$this->assertNotSame('+ +', '+ ' . \App\TextParser::getInstanceById($comment->getId(), 'ModComments')->setContent('+ $(relatedRecord : related_to|company)$ +')->parse()->getContent() . ' +', 'Lead creator email should be not empty');
- Exclude checks
Call to method isVaribleToParse
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_value']), 'Option: ' . $element['label'] . ', value: ' . $element['var_value'] . ' should be parseable in group: ' . $group);
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertIsArray
Open
$this->assertIsArray($content, 'Expected array type');
- Exclude checks
Call to method getInstance
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$arr = \App\TextParser::getInstance('IStorages')->getGeneralVariable();
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotEmpty
Open
$this->assertNotEmpty($arr, 'Expected any related variables data');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertIsArray
Open
$this->assertIsArray($data, 'Expected array type');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_label']), 'Option: ' . $element['label'] . ', value: ' . $element['var_label'] . ' should be parseable in group: ' . $group);
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertIsArray
Open
$this->assertIsArray($placeholders, 'Expected array type in group: ' . $groupName);
- Exclude checks
Call to method isVaribleToParse
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($item), 'Option: ' . $translation . ', value: ' . $item . ' should be parseable in group: ' . $groupName);
- Exclude checks
Call to method getInstanceByModel
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertNotSame('+ +', '+ ' . \App\TextParser::getInstanceByModel(\Tests\Base\C_RecordActions::createContactRecord())->setContent('+$(relatedRecord : parent_id|accountname)$+')->parse()->getContent() . ' +', 'Account name should be not empty(without module)');
- Exclude checks
Call to method getCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$invoiceModel->set('assigned_user_id', \App\User::getCurrentUserId());
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertIsArray
Open
$this->assertIsArray($arr, 'Expected (cached) array type');
- Exclude checks
Call to method isVaribleToParse
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($placeholder), 'Option: ' . $translation . ', value: ' . $placeholder . ' should be parseable in group: ' . $groupName);
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_label']), 'Option: ' . $element['label'] . ', value: ' . $element['var_label'] . ' should be parseable in group: ' . $group);
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
self::$parserRecord->setContent('+$(sourceRecord : description)$+')->setSourceRecord(\Tests\Base\C_RecordActions::createLeadRecord()->getId())->parse()->getContent(),
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
'+autogenerated test lead for \App\TextParser tests+', self::$parserClean->setContent('+$(sourceRecord : description)$+')->setSourceRecord(\Tests\Base\C_RecordActions::createLeadRecord()->getId())->parse()->getContent(),
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertIsArray
Open
$this->assertIsArray($group, 'Expected array type from group: ' . $groupName);
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotSame
Open
$this->assertNotSame('+ +', '+ ' . \App\TextParser::getInstanceByModel(\Tests\Base\C_RecordActions::createContactRecord())->setContent('+$(relatedRecord : parent_id|accountname|Accounts)$+')->parse()->getContent() . ' +', 'Account name should be not empty');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotSame
Open
$this->assertNotSame('+ +', '+ ' . self::$parserRecord->setContent('+$(relatedRecord : assigned_user_id|user_name|Users)$+')->parse()->getContent() . ' +', 'Lead creator user_name should be not empty');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($data['var_label']), 'Option: ' . $data['label'] . ', value: ' . $data['var_label'] . ' should be parseable in group: ' . $group);
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotEmpty
Open
$this->assertNotEmpty($content, 'Expected any related variables data');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertIsArray
Open
$this->assertIsArray($arr, 'Expected array type');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotSame
Open
$this->assertNotSame('+ +', '+ ' . \App\TextParser::getInstanceByModel(\Tests\Base\C_RecordActions::createContactRecord())->setContent('+$(relatedRecord : parent_id|accountname)$+')->parse()->getContent() . ' +', 'Account name should be not empty(without module)');
- Exclude checks
Call to method setContent
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertNotSame('+ +', '+ ' . self::$parserRecord->setContent('+$(relatedRecord : assigned_user_id|user_name|Users)$+')->parse()->getContent() . ' +', 'Lead creator user_name should be not empty');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame('-14.29 zł', \App\TextParser::getInstanceByModel($correctingInvoiceModel)->setContent('$(custom : AmountToReturn)$')->parse()->getContent());
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_value']), 'Option: ' . $element['label'] . ', value: ' . $element['var_value'] . ' should be parseable in group: ' . $group);
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_value']), 'Option: ' . $element['label'] . ', value: ' . $element['var_value'] . ' should be parseable in group: ' . $group);
- Exclude checks
Call to method getInstanceById
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertNotSame('+ +', '+ ' . \App\TextParser::getInstanceById($comment->getId(), 'ModComments')->setContent('+ $(relatedRecord : related_to|company)$ +')->parse()->getContent() . ' +', 'Lead creator email should be not empty');
- Exclude checks
Call to method getInstanceByModel
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame('-14.29 zł', \App\TextParser::getInstanceByModel($correctingInvoiceModel)->setContent('$(custom : AmountToReturn)$')->parse()->getContent());
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertSame
Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($item), 'Option: ' . $translation . ', value: ' . $item . ' should be parseable in group: ' . $groupName);
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotEmpty
Open
$this->assertNotEmpty($data, 'Expected any related variables data');
- Exclude checks
Call to method isVaribleToParse
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_label']), 'Option: ' . $element['label'] . ', value: ' . $element['var_label'] . ' should be parseable in group: ' . $group);
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertIsArray
Open
$this->assertIsArray($arr, 'Expected array type');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotEmpty
Open
$this->assertNotEmpty($arr, 'Expected any (cached) related variables data');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotEmpty
Open
$this->assertNotEmpty($arr, 'Expected any general variables data');
- Exclude checks
Call to undeclared method \Tests\App\TextParser::assertNotEmpty
Open
$this->assertNotEmpty($group, 'Expected any data in group: ' . $groupName);
- Exclude checks
Call to method getRelatedVariable
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$arr = self::$parserCleanModule->getRelatedVariable();
- Exclude checks
Call to method getRelatedVariable
from undeclared class \App\TextParser
(Did you mean class \Tests\App\TextParser) Open
$arr = self::$parserCleanModule->getRelatedVariable();
- Exclude checks
Call to method getCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$correctingInvoiceModel->set('assigned_user_id', \App\User::getCurrentUserId());
- Exclude checks
Identical blocks of code found in 2 locations. Consider refactoring. Open
foreach ($data as $element) {
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_value']), 'Option: ' . $element['label'] . ', value: ' . $element['var_value'] . ' should be parseable in group: ' . $group);
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_label']), 'Option: ' . $element['label'] . ', value: ' . $element['var_label'] . ' should be parseable in group: ' . $group);
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 114.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
foreach ($data as $element) {
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_value']), 'Option: ' . $element['label'] . ', value: ' . $element['var_value'] . ' should be parseable in group: ' . $group);
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_label']), 'Option: ' . $element['label'] . ', value: ' . $element['var_label'] . ' should be parseable in group: ' . $group);
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 114.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function testGetRelatedListVariable()
{
$arr = self::$parserCleanModule->getRelatedListVariable();
$this->assertIsArray($arr, 'Expected array type');
$this->assertNotEmpty($arr, 'Expected any related list data');
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 97.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function testGetBaseListVariable()
{
$arr = self::$parserClean->getBaseListVariable();
$this->assertIsArray($arr, 'Expected array type');
$this->assertNotEmpty($arr, 'Expected any related list data');
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 97.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Avoid excessively long variable names like $correctingInvoiceModel. Keep variable name length under 20. Open
$correctingInvoiceModel = \Vtiger_Record_Model::getCleanInstance('FCorectingInvoice');
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Only one argument is allowed per line in a multi-line function call Open
self::$parserRecord->setContent($text)->parse()->getContent(), 'Expected url is different');
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
self::$parserRecord->setContent($text)->parse()->getContent(), 'Expected url is different');
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
'+ +', self::$parserClean->setContent('+ $(sourceRecord : description)$ +')->parse()->getContent(),
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
'+autogenerated test lead for \App\TextParser tests+', self::$parserClean->setContent('+$(sourceRecord : description)$+')->setSourceRecord(\Tests\Base\C_RecordActions::createLeadRecord()->getId())->parse()->getContent(),
- 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
private static $parserClean;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Test record instance.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var \App\TextParser
- 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
private static $parserRecord;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var \App\TextParser
- 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
* Test clean instance.
- 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->assertInstanceOf('\App\TextParser', self::$parserCleanModule, 'Expected clean instance with module Leads of \App\TextParser');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertInstanceOf('\App\TextParser', self::$parserRecord, 'Expected instance from record model of \App\TextParser');
- 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->assertIsArray($arr, 'Expected array type');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ +', self::$parserClean
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'Clean instance: $(general : CurrentTime)$ should return current time');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'Clean instance: $(date : yesterday)$ should return yesterday date');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var \App\TextParser
- 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
'Clean instance: $(general : BaseTimeZone)$ should return system timezone');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserClean->setContent('+ $(general : UserTimeZone)$ +')->parse()->getContent(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent('+ $(general : SiteUrl)$ +')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testDate()
- 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
->getContent(), 'Clean instance: $(date : now)$ should return current date');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ ' . \date('Y-m-d', \strtotime('-1 day')) . ' +', self::$parserClean
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent('+ $(date : monday next week)$ +')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'Clean instance: $(date : monday next week)$ should return next week monday date');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Tests related module variables list.
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
$this->assertSame(1, \App\TextParser::isVaribleToParse('$(TestGroup : TestVar)$'), 'string should be parseable');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent('+ $(notExist : CurrentTime)$ +')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'Clean instance: $(general : SiteUrl)$ should return site url');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent('+ $(date : yesterday)$ +')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ ' . \date('Y-m-d', \strtotime('monday this week')) . ' +', self::$parserClean
- 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
foreach ($arr as $option) {
- 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->assertNotEmpty($arr, 'Expected any related list data');
- 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
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ ' . (new \DateTimeField(null))->getDisplayDate() . ' +', self::$parserClean
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'Clean instance: $(general : CurrentDate)$ should return current date');
- Exclude checks
Line exceeds 120 characters; contains 129 characters Open
$this->assertSame('+ ' . \Vtiger_Util_Helper::convertTimeIntoUsersDisplayFormat(date('H:i:s')) . ' +', self::$parserClean
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'+ ' . (empty($defaultTimeZone = date_default_timezone_get()) ? \App\Config::main('default_timezone') : $defaultTimeZone) . ' +',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ ' . \date('Y-m-d', \strtotime('first day of this month')) . ' +', self::$parserClean
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var \Vtiger_Record_Model Temporary Products record object. */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- 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 function testGetRelatedListVariable()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$arr = self::$parserCleanModule->getRelatedListVariable();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($arr as $option) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'Clean instance: unregistered function placeholder should return empty string');
- 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 instances creation.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testGetBaseListVariable()
- 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
->setContent('+ $(general : CurrentDate)$ +')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Tests date placeholders replacement.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Test clean instance with module.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotEmpty($arr, 'Expected any related list data');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertIsArray($arr, 'Expected array type');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent('+ $(general : PortalUrl)$ +')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertInstanceOf('\App\TextParser', self::$parserClean, 'Expected clean instance without module of \App\TextParser');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$recordLeads = $recordModel = \Tests\Base\C_RecordActions::createLeadRecord(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Tests empty content condition.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Tests static methods.
- 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
->getContent(), 'Clean instance: $(date : tomorrow)$ should return tommorow date');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ ' . \date('Y-m-d', \strtotime('monday next week')) . ' +', self::$parserClean
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private static $product;
- 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
->setContent('')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testUnregisteredFunction()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent('+ $(general : CurrentTime)$ +')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent('+ $(date : tomorrow)$ +')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- 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::$parserClean = \App\TextParser::getInstance();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($option['key']), 'Option: ' . $option['label'] . ', value: ' . $option['key'] . ' should be parseable');
- 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->assertSame('+ ' . \App\Config::main('site_URL') . ' +', self::$parserClean
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'Clean instance: $(general : PortalUrl)$ should return portal url');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private static $parserCleanModule;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var \Vtiger_Record_Model Temporary Leads record object. */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testInstancesCreation()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertInstanceOf('\App\TextParser', \App\TextParser::getInstanceById($recordModel->getId(), 'Leads'), 'Expected instance from lead id and module string of \App\TextParser');
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
$this->assertInstanceOf('\App\TextParser', self::$parserRecord, 'Expected instance from record model of \App\TextParser');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Line exceeds 120 characters; contains 171 characters Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($option['key']), 'Option: ' . $option['label'] . ', value: ' . $option['key'] . ' should be parseable');
- 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 141 characters Open
'+ ' . (empty($defaultTimeZone = date_default_timezone_get()) ? \App\Config::main('default_timezone') : $defaultTimeZone) . ' +',
- Exclude checks
Line exceeds 120 characters; contains 188 characters Open
$this->assertInstanceOf('\App\TextParser', \App\TextParser::getInstanceById($recordModel->getId(), 'Leads'), 'Expected instance from lead id and module string of \App\TextParser');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testEmptyContent()
- 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
* Tests base variables list.
- 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
$this->assertSame(1, \App\TextParser::isVaribleToParse($option['key']), 'Option: ' . $option['label'] . ', value: ' . $option['key'] . ' should be parseable');
- 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
'Clean instance: $(general : UserTimeZone)$ should return user timezone'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent('+ $(date : now)$ +')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ ' . \date('Y-m-d', \strtotime('+1 day')) . ' +', self::$parserClean
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('', self::$parserClean
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'Clean instance: empty content should return empty result');
- 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(1, \App\TextParser::isVaribleToParse($option['key']), 'Option: ' . $option['label'] . ', value: ' . $option['key'] . ' should be parseable');
- 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 $recordLeads;
- 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::$parserCleanModule = \App\TextParser::getInstance('Leads');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$arr = self::$parserClean->getBaseListVariable();
- 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(1, \App\TextParser::isVaribleToParse('$(TestGroup : TestVar)$'), 'string should be parseable');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(0, \App\TextParser::isVaribleToParse('$X(TestGroup : TestVar)$'), 'string should be not parseable');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserClean->setContent('+ $(general : BaseTimeZone)$ +')->parse()->getContent(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ PlaceholderNotExist +', self::$parserClean
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'Clean instance: $(general : PlaceholderNotExist)$ should return placeholder var name');
- 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
->setContent('+ $(date : monday this week)$ +')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'Clean instance: $(date : monday this week)$ should return this week monday date');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
$this->assertInstanceOf('\App\TextParser', self::$parserClean, 'Expected clean instance without module of \App\TextParser');
- Exclude checks
Line exceeds 120 characters; contains 141 characters Open
$this->assertInstanceOf('\App\TextParser', self::$parserCleanModule, 'Expected clean instance with module Leads of \App\TextParser');
- 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
* Tests general placeholders replacement.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testGeneral()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ ' . \Vtiger_Util_Helper::convertTimeIntoUsersDisplayFormat(date('H:i:s')) . ' +', self::$parserClean
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'+ ' . ($user->getDetail('time_zone') ?: \App\Config::main('default_timezone')) . ' +',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ ' . \App\Config::main('PORTAL_URL') . ' +', self::$parserClean
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ ' . \date('Y-m-d') . ' +', self::$parserClean
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserRecord = \App\TextParser::getInstanceByModel($recordModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testStaticMethods()
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
$this->assertSame(0, \App\TextParser::isVaribleToParse('$X(TestGroup : TestVar)$'), 'string should be not parseable');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Tests empty content condition.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$user = \App\User::getCurrentUserModel();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent('+ $(general : PlaceholderNotExist)$ +')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent($text)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '+ $(params : test_var_not_exist)$ +';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- 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 Employee placeholders.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->scalar();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$employeeModel = $employeeExistsId ? \Vtiger_Record_Model::getInstanceById($employeeExistsId, 'OSSEmployees') : \Vtiger_Record_Model::getCleanInstance('OSSEmployees');
- 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
->setContent($text)
- 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 function testBasicField()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->select(['crmid'])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'+ ' . \Vtiger_Record_Model::getInstanceById($employeeModel->getId(), 'OSSEmployees')->get('name') . ' +',
- 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
->scalar());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ +', self::$parserClean
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'Clean instance: By default employee last name should be empty');
- 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
$employeeUser->set('is_admin', 'on');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '$(recordsList : Leads|lead_no,company,email,description|[[["company","a","Test"]]]|All|5)$';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotEmpty($result, 'recordsList should return not empty string');
- 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
$text = '$(relatedRecordsList : Accounts|lead_no,lastname,phone,description|[[["company","a","Test"]]]|All|5)$';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
->getContent(), 'Clean instance: $(date : first day of this month)$ should return this month first day date');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testParams()
- 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 function testEmployee()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '+ $(employee : name)$ +';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testRecordsListPlaceholders()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotFalse(strpos($result, 'records-list'), 'Record list should contain html class recordsList');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ +', self::$parserClean
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->column(), ])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$employeeUser->set('last_name', 'YetiForce');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$employeeExistsId = (new \App\Db\Query())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Clean instance: Employee name should be same as in db'
- 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
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
->getContent(), 'Clean instance: $(date : first day of next month)$ should return next month first day date');
- 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
->getContent(), 'Clean instance: Test params placeholder should return value test');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->scalar();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$employeeUser->set('user_name', $userName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$employeeUser->set('user_password', \Tests\Base\A_User::$defaultPassrowd);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->from('vtiger_crmentity')->where(['deleted' => 0, 'setype' => 'OSSEmployees', 'smownerid' => $employeeUser->getId()])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$result = \App\TextParser::getInstance()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent($text)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '$(recordsList : Leads|lead_no,lastname,phone,description|[[["company","a","Test"]]]|NotExist|5)$';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$result = \App\TextParser::getInstanceByModel(self::$recordLeads)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ ' . \date('Y-m-d', \strtotime('last day of this month')) . ' +', self::$parserClean
- Exclude checks
Line exceeds 120 characters; contains 277 characters Open
\App\User::setCurrentUserId((new \App\Db\Query())->select(['id'])->from('vtiger_users')->where(['status' => 'Active'])->andWhere(['not in', 'id', (new \App\Db\Query())->select(['smownerid'])->from('vtiger_crmentity')->where(['deleted' => 0, 'setype' => 'OSSEmployees'])
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
->from('vtiger_crmentity')->where(['deleted' => 0, 'setype' => 'OSSEmployees', 'smownerid' => $employeeUser->getId()])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->limit(1)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(4, \substr_count($result, '<th '), 'Columns count should be equal to provided list');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$result = \App\TextParser::getInstanceByModel(self::$recordLeads)->withoutTranslations(true)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent($text)
- Exclude checks
Line exceeds 120 characters; contains 129 characters Open
$this->assertSame('test', self::$parserClean->getParam('test_var'), 'Clean instance: getParam should return value test');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent($text)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'Record instance: By default employee last name should be empty');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$employeeUser->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Cache::clear();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'+ ' . \Vtiger_Record_Model::getInstanceById($employeeModel->getId(), 'OSSEmployees')->get('name') . ' +',
- 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
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ ' . \date('Y-m-d', \strtotime('first day of next month')) . ' +', self::$parserClean
- 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
$tmpUser = \App\User::getCurrentUserId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$employeeUser->set('email1', $userName . '@yetiforce.com');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$employeeUser->set('roleid', 'H2');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$employeeModel->set('assigned_user_id', $employeeUser->getId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'Clean instance: Test param not exist, placeholder should return empty value');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('test', self::$parserClean->getParam('test_var'), 'Clean instance: getParam should return value 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
\App\Cache::clear();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\User::setCurrentUserId($employeeUser->getId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'Clean instance: $(date : first day of next month)$ should return next month first day date');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$employeeModel->set('name', 'Test employee');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\TextParser::getInstance()
- 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 basic field placeholder replacement.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent($text)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ +', self::$parserClean
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent($text)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Testing records list placeholders replacement.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Testing related records list placeholders replacement.
- 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->assertEmpty($result, 'relatedRecordsList should return empty string if no related records found');
- 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
->setContent('+ $(date : first day of next month)$ +')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'Clean instance: $(date : first day of this month)$ should return this month first day date');
- Exclude checks
Line exceeds 120 characters; contains 141 characters Open
$this->assertNull(self::$parserClean->getParam('test_var_not_exist'), 'Clean instance: key not exist, getParam should return false');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Testing params functions.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ test +', self::$parserClean
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent($text)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$employeeUser = $userExistsId ? \Vtiger_Record_Model::getInstanceById($userExistsId, 'Users') : \Vtiger_Record_Model::getCleanInstance('Users');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\User::setCurrentUserId($tmpUser);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\TextParser::getInstance()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent($text)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotEmpty($result, 'recordsList should return not empty string(CustomView not exists)');
- 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 function testRelatedRecordsList()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '+ $(params : test_var)$ +';
- 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
\App\User::setCurrentUserId((new \App\Db\Query())->select(['id'])->from('vtiger_users')->where(['status' => 'Active'])->andWhere(['not in', 'id', (new \App\Db\Query())->select(['smownerid'])->from('vtiger_crmentity')->where(['deleted' => 0, 'setype' => 'OSSEmployees'])
- Exclude checks
Line exceeds 120 characters; contains 152 characters Open
$employeeUser = $userExistsId ? \Vtiger_Record_Model::getInstanceById($userExistsId, 'Users') : \Vtiger_Record_Model::getCleanInstance('Users');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotEmpty($employeeUser->getId(), 'New user id should be not empty');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$employeeUser->set('confirm_password', \Tests\Base\A_User::$defaultPassrowd);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\User::setCurrentUserId($currentUser);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$employeeModel->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$result = \App\TextParser::getInstance()->withoutTranslations(true)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent($text)
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
$text = '$(relatedRecordsList : Leads|lead_no,lastname,phone,description|[[["company","a","Test"]]]|NotExist|5)$';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent('+ $(date : last day of this month)$ +')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'Clean instance: $(date : last day of this month)$ should return this month last day date');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserClean->setParams(['test_var' => 'test']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNull(self::$parserClean->getParam('test_var_not_exist'), 'Clean instance: key not exist, getParam should return false');
- 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
$text = '+ $(employee : last_name)$ +';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ +', self::$parserRecord
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$currentUser = \App\User::getCurrentUserId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userName = 'Employee';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userExistsId = (new \App\Db\Query())->select(['id'])->from('vtiger_users')->where(['user_name' => $userName])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Clean instance: Employee name should be same as in db(cached)'
- 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
$text = '$(relatedRecordsList : Leads|lead_no,lastname,phone,description|[[["company","a","Test"]]]|NotExist|5)$';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent('+ $(date : first day of this month)$ +')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent($text)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'Clean instance: By default employee last name should be empty(cached)');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$employeeUser->set('first_name', $userName);
- Exclude checks
Line exceeds 120 characters; contains 175 characters Open
$employeeModel = $employeeExistsId ? \Vtiger_Record_Model::getInstanceById($employeeExistsId, 'OSSEmployees') : \Vtiger_Record_Model::getCleanInstance('OSSEmployees');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent();
- 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
->getContent();
- Exclude checks
Line exceeds 120 characters; contains 147 characters Open
$this->assertSame('+ ' . \App\Config::main('PORTAL_URL') . '/index.php?module=Leads&action=index&id=' . self::$recordLeads->getId() . ' +',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '+ $(record : ChangesListChanges)$ +';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '+ $(record : ChangesListChanges)$ +';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ TestComment +', self::$parserRecord->setContent($text)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserClean->setContent('+$(general : CurrentDate)$ | $(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parseTranslations()->getContent(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$accountModel = \Tests\Base\C_RecordActions::createAccountRecord();
- 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
->setContent($text)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '+ $(custom : NotExists|NotExists)$ +';
- 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
$text = '+ $(record : PortalDetailViewURL)$ +';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$contactModel = \Tests\Base\C_RecordActions::createContactRecord();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '+ $(record : RecordLabel)$ +';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent();
- Exclude checks
Line exceeds 120 characters; contains 149 characters Open
$this->assertSame('+ $(translate : Leads|Email)$: test3@yetiforce.com<br> +', self::$parserRecord->setContent($text)->parse()->getContent());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '$(relatedRecordsList : Contacts|firstname,decision_maker,createdtime,contactstatus,verification|[[["firstname","a","Test"]]]|NotExists|5)$';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$recordLeads->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent($text)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertStringContainsString('test', self::$parserRecord->setContent($text)->parse()->getContent(), 'Test record changes list should should contain vat_id info');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '+ $(record : Comments 5|true)$ +';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'custom function with not existent Leads module parser should return empty string');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$comment->set('commentcontent', 'TestComment');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserRecord->setContent($text)->parse()->getContent(), 'Expected url is different');
- Exclude checks
Line exceeds 120 characters; contains 166 characters Open
'+$(general : CurrentDate)$ | ' . \App\Language::translate('LBL_SECONDS') . '==' . \App\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ Leads +', self::$parserRecord->setContent($text)->parse()->getContent(), 'Expected module name is different');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ ' . self::$recordLeads->getName() . ' +', self::$parserRecord->setContent($text)->parse()->getContent(), 'Expected record label is different');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '+ $(record : ChangesListChanges)$ +';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$comment->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'+$(general : CurrentDate)$ | ' . \App\Language::translate('LBL_SECONDS') . '==' . \App\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent($text)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ +', \App\TextParser::getInstance()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'custom function with not existent parser should return empty string');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ +', \App\TextParser::getInstance()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent($text)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Line exceeds 120 characters; contains 139 characters Open
$this->assertSame('+ Leads +', self::$parserRecord->setContent($text)->parse()->getContent(), 'Expected module name is different');
- Exclude checks
Line exceeds 120 characters; contains 167 characters Open
$this->assertSame('+ ' . self::$recordLeads->getId() . ' +', self::$parserRecord->setContent($text)->parse()->getContent(), 'Expected record id is different');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$recordLeads->set('vat_id', 'test');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Clean instance: Translations should be equal');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+',
- Exclude checks
Line exceeds 120 characters; contains 151 characters Open
self::$parserRecord->setContent('+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parse()->getContent(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+',
- Exclude checks
Line exceeds 120 characters; contains 151 characters Open
self::$parserRecord->setContent('+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parse()->getContent(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($data as $key => $element) {
- Exclude checks
Line exceeds 120 characters; contains 210 characters Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_value']), 'Option: ' . $element['label'] . ', value: ' . $element['var_value'] . ' should be parseable in group: ' . $group);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Tests source variables array.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($data['var_label']), 'Option: ' . $data['label'] . ', value: ' . $data['var_label'] . ' should be parseable in group: ' . $group);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testGetRelatedVariable()
- 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(1, \App\TextParser::isVaribleToParse($item), 'Option: ' . $translation . ', value: ' . $item . ' should be parseable in group: ' . $groupName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent();
- Exclude checks
Line exceeds 120 characters; contains 151 characters Open
$text = '$(relatedRecordsList : Contacts|firstname,decision_maker,createdtime,contactstatus,verification|[[["firstname","a","Test"]]]|All|5)$';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotEmpty($result, 'relatedRecordsList should return not empty string if related records found');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotEmpty($result, 'relatedRecordsList should return not empty string if related records found');
- 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 custom placeholders.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent($text)
- 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('+ ' . \App\Config::main('PORTAL_URL') . '/index.php?module=Leads&action=index&id=' . self::$recordLeads->getId() . ' +',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('Mail podstawowy: test3@yetiforce.com<br>', self::$parserRecord->setContent($text)->parse()->getContent());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ $(translate : Leads|Email)$: test3@yetiforce.com<br> +', self::$parserRecord->setContent($text)->parse()->getContent());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'Test record comments list should be empty');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserClean->setLanguage('pl-PL')->setContent('+$(general : CurrentDate)$ | $(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parseTranslations()->getContent(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($arr as $group => $data) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertIsArray($data, 'Expected array type');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotEmpty($data, 'Expected any related variables data');
- 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->assertIsArray($content, 'Expected array type');
- 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->assertSame(1, \App\TextParser::isVaribleToParse($element['var_value']), 'Option: ' . $element['label'] . ', value: ' . $element['var_value'] . ' should be parseable in group: ' . $group);
- Exclude checks
Line exceeds 120 characters; contains 214 characters Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_value']), 'Option: ' . $element['label'] . ', value: ' . $element['var_value'] . ' should be parseable in group: ' . $group);
- 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->assertIsArray($arr, 'Expected array type');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertIsArray($group, 'Expected array type from group: ' . $groupName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($group)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!\strpos($placeholder, ', ')) {
- Exclude checks
Line exceeds 120 characters; contains 157 characters Open
$text = '$(relatedRecordsList : Contacts|firstname,decision_maker,createdtime,contactstatus,verification|[[["firstname","a","Test"]]]|NotExists|5)$';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '+ $(custom : NotExists)$ +';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '+ $(record : NotExists)$ +';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ +', self::$parserRecord->setContent($text)->parse()->getContent());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$recordLeads->save();
- Exclude checks
Line exceeds 120 characters; contains 175 characters Open
$this->assertStringContainsString('test', self::$parserRecord->setContent($text)->parse()->getContent(), 'Test record changes list should should contain vat_id info');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'+' . \App\Language::translate('LBL_SECONDS') . '==' . \App\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Line exceeds 120 characters; contains 205 characters Open
$this->assertFalse(\App\TextParser::getInstance('Leads')->setSourceRecord(self::$recordLeads->getId())->getSourceVariable(), 'TextParser::getSourceVariable() should return false for Leads module');
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
$arr = \App\TextParser::getInstance('Campaigns')->setSourceRecord(self::$recordLeads->getId())->getSourceVariable();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertIsArray($arr, 'Expected array type');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($arr as $key => $content) {
- 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
foreach ($group as $placeholder => $translation) {
- 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
$text = '+ $(custom : NotExists|Leads)$ +';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserRecord->setContent($text)->parse()->getContent(), 'Expected url is different');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '+ $(record : RecordId)$ +';
- Exclude checks
Line exceeds 120 characters; contains 172 characters Open
$this->assertSame('+ ' . self::$recordLeads->getName() . ' +', self::$parserRecord->setContent($text)->parse()->getContent(), 'Expected record label is different');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserRecord->withoutTranslations(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$recordLeads->set('vat_id', 'testing');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Testing basic translate function.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testTranslate()
- Exclude checks
Line exceeds 120 characters; contains 150 characters Open
self::$parserClean->setContent('+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parse()->getContent(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserRecord->setContent('+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parse()->getContent(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertFalse(\App\TextParser::getInstance('Leads')->setSourceRecord(self::$recordLeads->getId())->getSourceVariable(), 'TextParser::getSourceVariable() should return false for Leads module');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$arr = \App\TextParser::getInstance('Campaigns')->setSourceRecord(self::$recordLeads->getId())->getSourceVariable();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($data as $element) {
- 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->assertNotEmpty($arr, 'Expected any related variables data');
- Exclude checks
Line exceeds 120 characters; contains 134 characters Open
$this->assertNotFalse(\strpos($result, $contactModel->get('firstname')), 'relatedRecordsList should contain test record row');
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
$result = \App\TextParser::getInstanceByModel(\Tests\Base\C_RecordActions::createAccountRecord())->withoutTranslations(true)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '+ $(custom : TableTaxSummary)$ +';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ ' . self::$recordLeads->getId() . ' +', self::$parserRecord->setContent($text)->parse()->getContent(), 'Expected record id is different');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '$(record : ChangesListValues)$';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Clean instance: Only translations should be replaced');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'+' . \App\Language::translate('LBL_SECONDS') . '==' . \App\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',
- 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 205 characters Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($data['var_label']), 'Option: ' . $data['label'] . ', value: ' . $data['var_label'] . ' should be parseable in group: ' . $group);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- 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->assertNotEmpty($data, 'Expected any related variables data');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotEmpty($arr, 'Expected any (cached) related variables data');
- 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
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotFalse(\strpos($result, $contactModel->get('firstname')), 'relatedRecordsList should contain test record row');
- Exclude checks
Line exceeds 120 characters; contains 134 characters Open
$this->assertNotFalse(\strpos($result, $contactModel->get('firstname')), 'relatedRecordsList should contain test record row');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ +', self::$parserRecord->setContent($text)->parse()->getContent());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserRecord->withoutTranslations(true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertStringContainsString('test', self::$parserRecord->setContent($text)->parse()->getContent(), 'Test record changes list should should contain vat_id info');
- Exclude checks
Line exceeds 120 characters; contains 175 characters Open
$this->assertStringContainsString('test', self::$parserRecord->setContent($text)->parse()->getContent(), 'Test record changes list should should contain vat_id info');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '+ $(record : company)$ +';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ +', self::$parserRecord->setContent($text)
- Exclude checks
Line exceeds 120 characters; contains 190 characters Open
self::$parserClean->setContent('+$(general : CurrentDate)$ | $(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parseTranslations()->getContent(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserClean->withoutTranslations(true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Tests record variables array.
- Exclude checks
Line exceeds 120 characters; contains 218 characters Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_label']), 'Option: ' . $element['label'] . ', value: ' . $element['var_label'] . ' should be parseable in group: ' . $group);
- 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->assertIsArray($content, 'Expected array type');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotEmpty($group, 'Expected any data in group: ' . $groupName);
- 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->assertEmpty($result, 'relatedRecordsList should return empty string if no related records found(CustomView not exists)');
- Exclude checks
Line exceeds 120 characters; contains 136 characters Open
$this->assertEmpty($result, 'relatedRecordsList should return empty string if no related records found(CustomView not exists)');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- 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::$parserRecord->withoutTranslations(true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserRecord->withoutTranslations(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserRecord->withoutTranslations(true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '+ $(record : FieldNotExists)$ +';
- 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(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($data['var_value'])) {
- 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->assertNotEmpty($arr, 'Expected any general variables data');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($arr as $groupName => $group) {
- 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 121 characters Open
$this->assertSame('+ +', self::$parserClean->setContent($text)->parse()->getContent(), 'Expected empty string');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '+ $(record : ChangesListValues)$ +';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$comment->set('related_to', self::$recordLeads->getId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'Test function record when field not exists should return empty string');
- 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::$parserClean->setContent('+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parse()->getContent(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserRecord->setContent('+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parse()->getContent(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Record instance: Translations should be equal');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotEmpty($arr, 'Expected any related variables data');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Tests related variables array.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$arr = self::$parserCleanModule->getRelatedVariable();
- Exclude checks
Line exceeds 120 characters; contains 214 characters Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_label']), 'Option: ' . $element['label'] . ', value: ' . $element['var_label'] . ' should be parseable in group: ' . $group);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertIsArray($arr, 'Expected (cached) array type');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$placeholders = \explode(', ', $placeholder);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testBasicSrcRecord()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '$(relatedRecordsList : Contacts|firstname,decision_maker,createdtime,contactstatus,verification|[[["firstname","a","Test"]]]|All|5)$';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$result = \App\TextParser::getInstanceByModel(\Tests\Base\C_RecordActions::createAccountRecord())->withoutTranslations(true)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserRecord->recordModel->set('email', 'test3@yetiforce.com')->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '+ $(record : ChangesListChanges)$ +';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Line exceeds 120 characters; contains 166 characters Open
'+$(general : CurrentDate)$ | ' . \App\Language::translate('LBL_SECONDS') . '==' . \App\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$arr = self::$parserCleanModule->getRecordVariable();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotEmpty($arr, 'Expected any related variables data');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_value']), 'Option: ' . $element['label'] . ', value: ' . $element['var_value'] . ' should be parseable in group: ' . $group);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$arr = self::$parserCleanModule->getRecordVariable();
- 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
$arr = \App\TextParser::getInstance('IStorages')->getGeneralVariable();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$contactModel->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testCustomPlaceholders()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->setContent($text)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->parse()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ +', self::$parserClean->setContent($text)->parse()->getContent(), 'Expected empty string');
- Exclude checks
Line exceeds 120 characters; contains 147 characters Open
$this->assertSame('+ ' . \App\Config::main('site_URL') . 'index.php?module=Leads&view=Detail&record=' . self::$recordLeads->getId() . ' +',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '+ $(record : ModuleName)$ +';
- Exclude checks
Line exceeds 120 characters; contains 133 characters Open
$this->assertSame('Mail podstawowy: test3@yetiforce.com<br>', self::$parserRecord->setContent($text)->parse()->getContent());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserRecord->withoutTranslations(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertStringContainsString('testing', self::$parserRecord->setContent($text)->parse()->getContent(), 'Test record changes list values should be not empty');
- Exclude checks
Line exceeds 120 characters; contains 171 characters Open
$this->assertStringContainsString('testing', self::$parserRecord->setContent($text)->parse()->getContent(), 'Test record changes list values should be not empty');
- Exclude checks
Line exceeds 120 characters; contains 186 characters Open
$this->assertSame('+ ' . self::$recordLeads->get('company') . ' +', self::$parserRecord->setContent($text)->parse()->getContent(), 'Test record company should be same as in db');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'+$(general : CurrentDate)$ | ' . \App\Language::translate('LBL_SECONDS') . '==' . \App\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',
- Exclude checks
Line exceeds 120 characters; contains 138 characters Open
'+' . \App\Language::translate('LBL_SECONDS') . '==' . \App\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserClean->setContent('+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parse()->getContent(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Clean instance: Translations should be equal');
- Exclude checks
Line exceeds 120 characters; contains 210 characters Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_label']), 'Option: ' . $element['label'] . ', value: ' . $element['var_label'] . ' should be parseable in group: ' . $group);
- Exclude checks
Line exceeds 120 characters; contains 218 characters Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_value']), 'Option: ' . $element['label'] . ', value: ' . $element['var_value'] . ' should be parseable in group: ' . $group);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertIsArray($arr, 'Expected array type');
- 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->assertIsArray($placeholders, 'Expected array type in group: ' . $groupName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($placeholders as $item) {
- Exclude checks
Line exceeds 120 characters; contains 189 characters Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($item), 'Option: ' . $translation . ', value: ' . $item . ' should be parseable in group: ' . $groupName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Testing basic source record related functions.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotFalse(\strpos($result, $contactModel->get('firstname')), 'relatedRecordsList should contain test record row');
- 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
$text = '+ $(record : CrmDetailViewURL)$ +';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ ' . \App\Config::main('site_URL') . 'index.php?module=Leads&view=Detail&record=' . self::$recordLeads->getId() . ' +',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$text = '+ $(record : ChangesListValues)$ +';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserRecord->withoutTranslations(false);
- 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->assertIsArray($arr, 'Expected array type');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testGetSourceVariable()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($data as $element) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Tests general variables array.
- Exclude checks
Line exceeds 120 characters; contains 199 characters Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($placeholder), 'Option: ' . $translation . ', value: ' . $placeholder . ' should be parseable in group: ' . $groupName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotEmpty($placeholders, 'Expected any group data in group: ' . $groupName);
- 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
->getContent(), 'custom function with not existent parser should return empty string');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ +', \App\TextParser::getInstance()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Testing record vars placeholders replacement.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$comment = \Vtiger_Record_Model::getCleanInstance('ModComments');
- Exclude checks
Line exceeds 120 characters; contains 212 characters Open
self::$parserClean->setLanguage('pl-PL')->setContent('+$(general : CurrentDate)$ | $(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parseTranslations()->getContent(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(
- Exclude checks
Line exceeds 120 characters; contains 138 characters Open
'+' . \App\Language::translate('LBL_SECONDS') . '==' . \App\Language::translate('LBL_COPY_BILLING_ADDRESS', 'Accounts') . '+',
- Exclude checks
Line exceeds 120 characters; contains 205 characters Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($data['var_value']), 'Option: ' . $data['label'] . ', value: ' . $data['var_value'] . ' should be parseable in group: ' . $group);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($arr as $key => $content) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($content as $group => $data) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertIsArray($data, 'Expected array type');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$contactModel->set('parent_id', $accountModel->getId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$result = \App\TextParser::getInstanceByModel($accountModel)->withoutTranslations(true)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ +', \App\TextParser::getInstance()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->getContent(), 'custom function with TableTaxSummary parser should return empty string');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testRecord()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('+ ' . self::$recordLeads->get('company') . ' +', self::$parserRecord->setContent($text)->parse()->getContent(), 'Test record company should be same as in db');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Clean instance: Only translations should be replaced(setLanguage)');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserRecord->withoutTranslations(true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testGetRecordVariable()
- 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(1, \App\TextParser::isVaribleToParse($element['var_label']), 'Option: ' . $element['label'] . ', value: ' . $element['var_label'] . ' should be parseable in group: ' . $group);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertIsArray($arr, 'Expected (cached) array type');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotEmpty($arr, 'Expected any (cached) related variables data');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertIsArray($data, 'Expected array type');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_label']), 'Option: ' . $element['label'] . ', value: ' . $element['var_label'] . ' should be parseable in group: ' . $group);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($element['var_label']), 'Option: ' . $element['label'] . ', value: ' . $element['var_label'] . ' should be parseable in group: ' . $group);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($placeholder), 'Option: ' . $translation . ', value: ' . $placeholder . ' should be parseable in group: ' . $groupName);
- 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
foreach ($content as $group => $data) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotEmpty($data, 'Expected any related variables data');
- 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->assertNotEmpty($content, 'Expected any related variables data');
- 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
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Testing related record placeholders.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventory['discountmode'] = 1;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventory['discountparam'] = json_encode([
- Exclude checks
Line exceeds 120 characters; contains 150 characters Open
self::$parserClean->setContent('+$(translate : LBL_SECONDS)$==$(translate : Accounts|LBL_COPY_BILLING_ADDRESS)$+')->parse()->getContent(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserClean->withoutTranslations(false);
- 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->assertNotEmpty($content, 'Expected any related variables data');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(1, \App\TextParser::isVaribleToParse($data['var_value']), 'Option: ' . $data['label'] . ', value: ' . $data['var_value'] . ' should be parseable in group: ' . $group);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testGetGeneralVariable()
- 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
public function testAmountToReturn(): 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
$invoiceModel->saveInventoryData();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$correctingInvoiceModel->set('assigned_user_id', \App\User::getCurrentUserId());
- 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
$inventory['currency'] = \Vtiger_Util_Helper::getBaseCurrency()['id'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'aggregationType' => 'individual',
- 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
Line exceeds 120 characters; contains 178 characters Open
self::$parserRecord->setContent('+$(sourceRecord : description)$+')->setSourceRecord(\Tests\Base\C_RecordActions::createLeadRecord()->getId())->parse()->getContent(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotSame('+ +', '+ ' . \App\TextParser::getInstanceByModel(\Tests\Base\C_RecordActions::createContactRecord())->setContent('+$(relatedRecord : parent_id|accountname|Accounts)$+')->parse()->getContent() . ' +', 'Account name should be not empty');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$comment->set('commentcontent', 'TestComment');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$correctingInvoiceModel->set('subject', $subject);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Create Inventory for Amount to return test.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventory['taxmode'] = 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'globalTax' => 0,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(
- 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
private function createInventory(): array
- 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::$parserClean->setContent('+ $(sourceRecord : description)$ +')->parse()->getContent(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'+autogenerated test lead for \App\TextParser tests+', self::$parserClean->setContent('+$(sourceRecord : description)$+')->setSourceRecord(\Tests\Base\C_RecordActions::createLeadRecord()->getId())->parse()->getContent(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Clean instance: Translations should be equal');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Record instance: Translations should be equal');
- Exclude checks
Line exceeds 120 characters; contains 267 characters Open
$this->assertNotSame('+ +', '+ ' . \App\TextParser::getInstanceByModel(\Tests\Base\C_RecordActions::createContactRecord())->setContent('+$(relatedRecord : parent_id|accountname|Accounts)$+')->parse()->getContent() . ' +', 'Account name should be not empty');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$invoiceModel->set('subject', $subject);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$correctingInvoiceModel = \Vtiger_Record_Model::getCleanInstance('FCorectingInvoice');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventory['qty'] = 1;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Clean instance: returned string should be empty if no source record provided');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$invoiceModel->set('assigned_user_id', \App\User::getCurrentUserId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->createProduct();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$invoiceModel->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$invoiceModel->delete();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'aggregationType' => 'individual',
- 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
* Cleaning after tests.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Record instance: Translations should be equal');
- 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->assertSame(1, \App\TextParser::isVaribleToParse($element['var_value']), 'Option: ' . $element['label'] . ', value: ' . $element['var_value'] . ' should be parseable in group: ' . $group);
- 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
$arr = self::$parserCleanModule->getRelatedVariable();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$correctingInvoiceModel->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotSame('+ +', '+ ' . \App\TextParser::getInstanceByModel(\Tests\Base\C_RecordActions::createContactRecord())->setContent('+$(relatedRecord : parent_id|accountname)$+')->parse()->getContent() . ' +', 'Account name should be not empty(without module)');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventory['price'] = 110;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventory['discount'] = 26.4;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$correctingInvoiceModel->delete();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventory['price'] = 100;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventory['taxparam'] = json_encode([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$comment->set('related_to', \Tests\Base\C_RecordActions::createLeadRecord()->getId());
- 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
$inventory = $this->createInventory();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'individualTax' => 88,
- 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::$product->set('productname', 'Test');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$parserRecord->setContent('+$(sourceRecord : description)$+')->setSourceRecord(\Tests\Base\C_RecordActions::createLeadRecord()->getId())->parse()->getContent(),
- 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
$correctingInvoiceModel->set('finvoiceid', $invoiceModel->getId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('-14.29 zł', \App\TextParser::getInstanceByModel($correctingInvoiceModel)->setContent('$(custom : AmountToReturn)$')->parse()->getContent());
- Exclude checks
Line exceeds 120 characters; contains 168 characters Open
$this->assertSame('-14.29 zł', \App\TextParser::getInstanceByModel($correctingInvoiceModel)->setContent('$(custom : AmountToReturn)$')->parse()->getContent());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Line exceeds 120 characters; contains 232 characters Open
'+autogenerated test lead for \App\TextParser tests+', self::$parserClean->setContent('+$(sourceRecord : description)$+')->setSourceRecord(\Tests\Base\C_RecordActions::createLeadRecord()->getId())->parse()->getContent(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$comment = \Vtiger_Record_Model::getCleanInstance('ModComments');
- 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
public function testRelatedRecord()
- Exclude checks
Line exceeds 120 characters; contains 274 characters Open
$this->assertNotSame('+ +', '+ ' . \App\TextParser::getInstanceByModel(\Tests\Base\C_RecordActions::createContactRecord())->setContent('+$(relatedRecord : parent_id|accountname)$+')->parse()->getContent() . ' +', 'Account name should be not empty(without module)');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$invoiceModel->initInventoryData([$inventory]);
- 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
* Crete Products record.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$product->delete();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(
- 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->assertNotSame('+ +', '+ ' . self::$parserRecord->setContent('+$(relatedRecord : assigned_user_id|user_name|Users)$+')->parse()->getContent() . ' +', 'Lead creator user_name should be not empty');
- Exclude checks
Line exceeds 120 characters; contains 211 characters Open
$this->assertNotSame('+ +', '+ ' . self::$parserRecord->setContent('+$(relatedRecord : assigned_user_id|user_name|Users)$+')->parse()->getContent() . ' +', 'Lead creator user_name should be not empty');
- 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
$inventory['comment1'] = 'test';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $inventory;
- 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::$product = \Vtiger_Record_Model::getCleanInstance('Products');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$comment->save();
- Exclude checks
Line exceeds 120 characters; contains 242 characters Open
$this->assertNotSame('+ +', '+ ' . \App\TextParser::getInstanceById($comment->getId(), 'ModComments')->setContent('+ $(relatedRecord : related_to|company)$ +')->parse()->getContent() . ' +', 'Lead creator email should be not empty');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* test Amount to Return.
- 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
'individualDiscount' => 24,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventory['name'] = self::$product->getId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventory['unit'] = 'Hours';
- 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->assertNotSame('+ +', '+ ' . \App\TextParser::getInstanceById($comment->getId(), 'ModComments')->setContent('+ $(relatedRecord : related_to|company)$ +')->parse()->getContent() . ' +', 'Lead creator email should be not empty');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$subject = 'FV' . date('Y/m/d');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$correctingInvoiceModel->initInventoryData([$inventory]);
- 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
$inventory = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'individualDiscountType' => 'percentage',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventory['discount'] = 24;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private function createProduct(): 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
* @return void
- 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
'+autogenerated test lead for \App\TextParser tests+',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$invoiceModel = \Vtiger_Record_Model::getCleanInstance('FInvoice');
- 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
self::$product->save();
- Exclude checks
Multi-line function call not indented correctly; expected 8 spaces but found 12 Open
'Clean instance: $(general : BaseTimeZone)$ should return system timezone');
- Exclude checks
Closing parenthesis of a multi-line function call must be on a line by itself Open
'Clean instance: $(general : BaseTimeZone)$ should return system timezone');
- Exclude checks
Multi-line function call not indented correctly; expected 8 spaces but found 12 Open
'Clean instance: Only translations should be replaced(setLanguage)');
- Exclude checks
Closing parenthesis of a multi-line function call must be on a line by itself Open
self::$parserRecord->setContent($text)->parse()->getContent(), 'Expected url is different');
- Exclude checks
Multi-line function call not indented correctly; expected 8 spaces but found 12 Open
'Clean instance: Translations should be equal');
- Exclude checks
Closing parenthesis of a multi-line function call must be on a line by itself Open
'Clean instance: Only translations should be replaced');
- Exclude checks
Closing parenthesis of a multi-line function call must be on a line by itself Open
'Record instance: Translations should be equal');
- Exclude checks
Closing parenthesis of a multi-line function call must be on a line by itself Open
self::$parserRecord->setContent($text)->parse()->getContent(), 'Expected url is different');
- Exclude checks
Closing parenthesis of a multi-line function call must be on a line by itself Open
'Clean instance: Translations should be equal');
- Exclude checks
Closing parenthesis of a multi-line function call must be on a line by itself Open
'Record instance: Translations should be equal');
- Exclude checks
Multi-line function call not indented correctly; expected 8 spaces but found 12 Open
'Record instance: Translations should be equal');
- Exclude checks
Opening parenthesis of a multi-line function call must be the last content on the line Open
$this->assertSame('+ ' . \App\Config::main('site_URL') . 'index.php?module=Leads&view=Detail&record=' . self::$recordLeads->getId() . ' +',
- Exclude checks
Multi-line function call not indented correctly; expected 8 spaces but found 12 Open
'Clean instance: Only translations should be replaced');
- Exclude checks
Multi-line function call not indented correctly; expected 8 spaces but found 12 Open
'Clean instance: Translations should be equal');
- Exclude checks
Opening parenthesis of a multi-line function call must be the last content on the line Open
$this->assertSame('+ ' . \App\Config::main('PORTAL_URL') . '/index.php?module=Leads&action=index&id=' . self::$recordLeads->getId() . ' +',
- Exclude checks
Closing parenthesis of a multi-line function call must be on a line by itself Open
'Clean instance: Only translations should be replaced(setLanguage)');
- Exclude checks
Closing parenthesis of a multi-line function call must be on a line by itself Open
'Record instance: Translations should be equal');
- Exclude checks
Closing parenthesis of a multi-line function call must be on a line by itself Open
'Clean instance: Translations should be equal');
- Exclude checks
Closing parenthesis of a multi-line function call must be on a line by itself Open
'Clean instance: returned string should be empty if no source record provided');
- Exclude checks
Multi-line function call not indented correctly; expected 8 spaces but found 12 Open
'Clean instance: Translations should be equal');
- Exclude checks
Closing parenthesis of a multi-line function call must be on a line by itself Open
'Clean instance: Translations should be equal');
- Exclude checks
Multi-line function call not indented correctly; expected 8 spaces but found 12 Open
'Record instance: Translations should be equal');
- Exclude checks
Multi-line function call not indented correctly; expected 8 spaces but found 12 Open
'Record instance: Translations should be equal');
- Exclude checks
Multi-line function call not indented correctly; expected 8 spaces but found 12 Open
'Clean instance: returned string should be empty if no source record provided');
- Exclude checks