testCurrentRoomAfterDeletingRecord accesses the super-global variable $_SESSION. Open
public function testCurrentRoomAfterDeletingRecord(): void
{
$this->assertSame($_SESSION['chat']['roomType'], 'crm');
$this->assertSame($_SESSION['chat']['recordId'], self::$listId[0]);
\vtlib\Functions::clearCacheMetaDataRecord(self::$listId[0]);
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
testCurrentRoomAfterDeletingRecord accesses the super-global variable $_SESSION. Open
public function testCurrentRoomAfterDeletingRecord(): void
{
$this->assertSame($_SESSION['chat']['roomType'], 'crm');
$this->assertSame($_SESSION['chat']['recordId'], self::$listId[0]);
\vtlib\Functions::clearCacheMetaDataRecord(self::$listId[0]);
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
testSwitchRoom accesses the super-global variable $_SESSION. Open
public function testSwitchRoom()
{
\App\Chat::setCurrentRoom('crm', self::$listId[0]);
$this->assertSame($_SESSION['chat']['roomType'], 'crm');
$this->assertSame($_SESSION['chat']['recordId'], self::$listId[0]);
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
testSwitchRoom accesses the super-global variable $_SESSION. Open
public function testSwitchRoom()
{
\App\Chat::setCurrentRoom('crm', self::$listId[0]);
$this->assertSame($_SESSION['chat']['roomType'], 'crm');
$this->assertSame($_SESSION['chat']['recordId'], self::$listId[0]);
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
testCurrentRoom accesses the super-global variable $_SESSION. Open
public function testCurrentRoom()
{
unset($_SESSION);
\App\Chat::setCurrentRoom('global', self::$globalRoom['global_room_id']);
$this->assertSame($_SESSION['chat']['roomType'], 'global');
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
testCurrentRoom accesses the super-global variable $_SESSION. Open
public function testCurrentRoom()
{
unset($_SESSION);
\App\Chat::setCurrentRoom('global', self::$globalRoom['global_room_id']);
$this->assertSame($_SESSION['chat']['roomType'], 'global');
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
testCurrentRoom accesses the super-global variable $_SESSION. Open
public function testCurrentRoom()
{
unset($_SESSION);
\App\Chat::setCurrentRoom('global', self::$globalRoom['global_room_id']);
$this->assertSame($_SESSION['chat']['roomType'], 'global');
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
The class Z_Chat has 16 public methods. Consider refactoring Z_Chat to keep number of public methods under 10. Open
class Z_Chat extends \Tests\Base
{
/**
* ID list.
*
- 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
File Z_Chat.php
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Chat test class.
*
Function getKeyRoom
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static function getKeyRoom($userRooms, string $roomType, int $recordId)
{
if (isset($userRooms[$roomType]) && \is_array($userRooms[$roomType])) {
foreach ($userRooms[$roomType] as $key => $val) {
if ($val['recordid'] === $recordId) {
- 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
The class Z_Chat has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13. Open
class Z_Chat extends \Tests\Base
{
/**
* ID list.
*
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
Missing class import via use statement (line '137', column '28'). Open
self::$globalRoom = (new \App\Db\Query())->from('u_#__chat_global')->where(['name' => 'LBL_GENERAL'])->one();
- 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 '310', column '18'). Open
$rowMsg = (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 '336', column '18'). Open
$rowMsg = (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 '162', column '18'). Open
$rowMsg = (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 '403', column '9'). Open
(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 '440', column '9'). Open
(new \Settings_ModuleManager_Module_Model())->disableModule('Chat');
- 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 '409', column '9'). Open
(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 '192', column '15'). Open
$row = (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 '217', column '27'). Open
$this->assertFalse((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 '288', column '19'). Open
$rowRoom = (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 '245', column '18'). Open
$rowMsg = (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
Avoid using static access to class '\App\Module' in method 'setUpBeforeClass'. Open
self::$chatActive = \App\Module::isModuleActive('Chat');
- 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 'testGroup'. Open
\App\User::setCurrentUserId(\App\User::getActiveAdminId());
- 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 'testRemoveFromFavorites'. Open
->where(['userid' => \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 '\Vtiger_Record_Model' in method 'testRemoveRecordCrm'. Open
$recordModel = \Vtiger_Record_Model::getInstanceById(self::$listId[0]);
- 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 'testAssigningToGroup'. Open
->where(['userid' => \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\Chat' in method 'testRemoveFromFavorites'. Open
$chat = \App\Chat::getInstance('group', $groupId);
- 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\Chat' in method 'testNewMessage'. Open
$chat = \App\Chat::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\Chat' in method 'testNewMessage'. Open
$this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- 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 'testCreatingChatRoomCrm'. Open
$recordModel = \Vtiger_Record_Model::getInstanceById(self::$listId[0]);
- 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 'testAddMessageCrm'. Open
$recordModel = \Vtiger_Record_Model::getInstanceById(self::$listId[0]);
- 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 'setUpBeforeClass'. Open
\App\User::setCurrentUserId(\App\User::getActiveAdminId());
- 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\Chat' in method 'testNewMessage'. Open
$chat = \App\Chat::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\Chat' in method 'testNewMessage'. Open
$this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- 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\Chat' in method 'testNewMessage'. Open
$chat = \App\Chat::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\Chat' in method 'testAddMessageCrm'. Open
$chat = \App\Chat::getInstance('crm', $recordModel->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\Module' in method 'testConfiguration'. Open
$this->assertTrue(\App\Module::isModuleActive('Chat'), 'The chat module is inactive');
- 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 'testAddNewMessage'. Open
$this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
- 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\Chat' in method 'testCreatingChatRoomCrm'. Open
$rooms = \App\Chat::getRoomsByUser();
- 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\Chat' in method 'testRoomCrm'. Open
$chat = \App\Chat::getInstance('crm', self::$listId[0]);
- 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 '\vtlib\Functions' in method 'testCurrentRoomAfterDeletingRecord'. Open
\vtlib\Functions::clearCacheMetaDataRecord(self::$listId[0]);
- 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 'tearDownAfterClass'. Open
\App\User::setCurrentUserId(\App\User::getActiveAdminId());
- 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\Chat' in method 'testNewMessage'. Open
$this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- 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 'testNewMessage'. Open
\App\User::setCurrentUserId(self::$users[1]);
- 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\Record' in method 'testCurrentRoomAfterDeletingRecord'. Open
$this->assertFalse(\App\Record::isExists(self::$listId[0]), 'The record should not exist');
- 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 'testAssigningToGroup'. Open
\App\User::setCurrentUserId(\App\User::getActiveAdminId());
- 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\Chat' in method 'testNewMessage'. Open
$this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- 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\Chat' in method 'testAssigningToGroup'. Open
$chat = \App\Chat::getInstance('group', $groupId);
- 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\Chat' in method 'testHistory'. Open
$chat = \App\Chat::getInstance('global', self::$globalRoom['global_room_id']);
- 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 'testGroup'. Open
\App\User::setCurrentUserId(\App\User::getActiveAdminId());
- 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 'testGroup'. Open
$this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
- 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 'testHistory'. Open
$userId = \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\User' in method 'testNewMessage'. Open
\App\User::setCurrentUserId(self::$users[0]);
- 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 'tearDownAfterClass'. Open
$recordModel = \Vtiger_Record_Model::getInstanceById($id);
- 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 'setUpBeforeClass'. Open
\App\User::setCurrentUserId(\App\User::getActiveAdminId());
- 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 'setUpBeforeClass'. Open
$recordModel = C_RecordActions::createContactRecord(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\Chat' in method 'testSwitchRoom'. Open
$currentRoom = \App\Chat::getCurrentRoom();
- 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 'testAssigningToGroup'. Open
\App\User::setCurrentUserId(\App\User::getActiveAdminId());
- 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\Chat' in method 'testNewMessage'. Open
$this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- 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\Chat' in method 'testSwitchRoom'. Open
\App\Chat::setCurrentRoom('crm', self::$listId[0]);
- 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 'tearDownAfterClass'. Open
\App\User::setCurrentUserId(\App\User::getActiveAdminId());
- 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\Chat' in method 'testCurrentRoom'. Open
\App\Chat::setCurrentRoom('global', self::$globalRoom['global_room_id']);
- 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\Chat' in method 'testCreatingChatRoomCrm'. Open
$chat = \App\Chat::createRoom('crm', $recordModel->getId());
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\User' in method 'testRoomCrm'. Open
$userId = \App\User::getActiveAdminId();
- 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\Chat' in method 'testRoomCrm'. Open
$this->assertFalse(\App\Chat::isNewMessagesForCrm($userId), 'Problem with the method "isNewMessagesForCrm"');
- 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\Chat' in method 'testGroup'. Open
$chat = \App\Chat::getInstance('group', $groupId);
- 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\Chat' in method 'testAddNewMessage'. Open
$chat = \App\Chat::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\Chat' in method 'testNewMessage'. Open
$this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- 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 'testAddMessageCrm'. Open
$this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
- 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 'testRoomCrm'. Open
\App\User::setCurrentUserId($userId);
- 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\Chat' in method 'testRoomCrm'. Open
$this->assertFalse(\App\Chat::isNewMessagesForCrm($userId), 'Problem with the method "isNewMessagesForCrm"');
- 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 'testRoomCrm'. Open
$this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
- 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\Chat' in method 'testCurrentRoomAfterDeletingRecord'. Open
$currentRoom = \App\Chat::getCurrentRoom();
- 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 "userid" 9 times. Open
$this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
- 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 "roomType" 4 times. Open
$this->assertSame($_SESSION['chat']['roomType'], 'global');
- 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 "user_name" 6 times. Open
$this->assertSame(\App\User::getCurrentUserModel()->getName(), $entries[$key]['user_name']);
- 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 "global" 4 times. Open
\App\Chat::setCurrentRoom('global', self::$globalRoom['global_room_id']);
- 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 "Problem with the method "getEntries"" 3 times. Open
$this->assertNotFalse($key, 'Problem with the method "getEntries"');
- 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 "message" 6 times. Open
->from(\App\Chat::TABLE_NAME['message'][$chat->getRoomType()])
- 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 "messages" 13 times. Open
$this->assertSame('Test MSG', $rowMsg['messages']);
- 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 "global_room_id" 3 times. Open
\App\Chat::setCurrentRoom('global', self::$globalRoom['global_room_id']);
- 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 "Problem with the method "isNewMessages"" 6 times. Open
$this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- 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 "group" 4 times. Open
$chat = \App\Chat::getInstance('group', $groupId);
- 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 "recordId" 4 times. Open
$this->assertSame($_SESSION['chat']['recordId'], self::$globalRoom['global_room_id']);
- 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.
Remove this unused private "getUserFromParticipants" method. Open
private static function getUserFromParticipants($participants, int $userId)
- Read upRead up
- Exclude checks
private
methods that are never executed are dead code: unnecessary, inoperative code that should be removed. Cleaning out dead code
decreases the size of the maintained codebase, making it easier to understand the program and preventing bugs from being introduced.
Noncompliant Code Example
public class Foo { private function Foo() {} // Compliant, private empty constructor intentionally used to prevent any direct instantiation of a class. public static function doSomething() { $foo = new Foo(); ... } private function unusedPrivateFunction() { // Noncompliant } }
Compliant Solution
public class Foo { private function Foo(){} // Compliant, private empty constructor intentionally used to prevent any direct instantiation of a class. public static function doSomething() { $foo = new Foo(); } }
See
- CERT, MSC07-CPP. - Detect and remove dead code
Avoid unused private methods such as 'getUserFromParticipants'. Open
private static function getUserFromParticipants($participants, int $userId)
{
foreach ($participants as $key => $val) {
if ($val['user_id'] === $userId) {
return $key;
- Read upRead up
- Exclude checks
UnusedPrivateMethod
Since: 0.2
Unused Private Method detects when a private method is declared but is unused.
Example
class Something
{
private function foo() {} // unused
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod
Avoid unused local variables such as '$currentRoom'. Open
$currentRoom = \App\Chat::getCurrentRoom();
- 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
Reference to constant TABLE_NAME
from undeclared class \App\Chat
Open
->from(\App\Chat::TABLE_NAME['message'][$chat->getRoomType()])
- Exclude checks
Call to method getCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertIsInt
Open
$this->assertIsInt($id);
- Exclude checks
Call to method getInstance
from undeclared class \App\Chat
Open
$chat = \App\Chat::getInstance('group', $groupId);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame($rowMsg['messages'], $entries[$key]['messages']);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame(\App\User::getCurrentUserModel()->getName(), $entries[$key]['user_name']);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertTrue
Open
$this->assertTrue(\App\Module::isModuleActive('Chat'), 'The chat module is inactive');
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$rowMsg = (new \App\Db\Query())
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
Open
$this->assertNotFalse($key, 'Problem with the method "getEntries"');
- Exclude checks
Call to method getActiveAdminId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
\App\User::setCurrentUserId(\App\User::getActiveAdminId());
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertTrue
Open
$this->assertTrue($chat->isRoomExists(), "The chat room does not exist '{$groups[$groupId]}'");
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertGreaterThanOrEqual
Open
$this->assertGreaterThanOrEqual(1, \count($groups), 'No defined groups');
- Exclude checks
Call to method getCurrentUserModel
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$groups = \App\User::getCurrentUserModel()->getGroupNames();
- Exclude checks
Call to method getCurrentUserModel
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$groups = \App\User::getCurrentUserModel()->getGroupNames();
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$row = (new \App\Db\Query())
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
self::$globalRoom = (new \App\Db\Query())->from('u_#__chat_global')->where(['name' => 'LBL_GENERAL'])->one();
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertTrue
Open
$this->assertTrue($chat->isAssigned(), "The user should be assigned '{$groups[$groupId]}'");
- Exclude checks
Call to method setCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
\App\User::setCurrentUserId(\App\User::getActiveAdminId());
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertTrue
Open
$this->assertTrue($chat->isRoomExists(), "The chat room does not exist '{$groups[$groupId]}'");
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
Open
$this->assertNotFalse($rowMsg, "The message {$id} does not exist");
- Exclude checks
Call to method setCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
\App\User::setCurrentUserId(\App\User::getActiveAdminId());
- Exclude checks
Reference to constant TABLE_NAME
from undeclared class \App\Chat
Open
->from(\App\Chat::TABLE_NAME['room'][$chat->getRoomType()])
- Exclude checks
Call to method setCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
\App\User::setCurrentUserId(\App\User::getActiveAdminId());
- Exclude checks
Call to method getInstance
from undeclared class \App\Chat
Open
$chat = \App\Chat::getInstance('group', $groupId);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertTrue
Open
$this->assertTrue($chat->isRoomExists(), "The chat room does not exist '{$groups[$groupId]}'");
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame('Test MSG', $rowMsg['messages']);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertFalse
Open
$this->assertFalse($chat->isAssigned(), "The user should not be assigned '{$groups[$groupId]}'");
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertFalse
Open
$this->assertFalse($chat->isAssigned(), "The user should not be assigned '{$groups[$groupId]}'");
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertCount
Open
$this->assertCount($cntEntries + 1, $entries, 'Too many messages in the chat room');
- Exclude checks
Call to method getActiveAdminId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
\App\User::setCurrentUserId(\App\User::getActiveAdminId());
- Exclude checks
Call to method getActiveAdminId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
\App\User::setCurrentUserId(\App\User::getActiveAdminId());
- Exclude checks
Call to method getCurrentUserModel
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$this->assertSame(\App\User::getCurrentUserModel()->getName(), $entries[$key]['user_name']);
- Exclude checks
Call to method getInstance
from undeclared class \App\Chat
Open
$chat = \App\Chat::getInstance();
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertFalse
Open
$this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertTrue
Open
$this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- Exclude checks
Call to method createRoom
from undeclared class \App\Chat
Open
$chat = \App\Chat::createRoom('crm', $recordModel->getId());
- Exclude checks
Reference to constant TABLE_NAME
from undeclared class \App\Chat
Open
->from(\App\Chat::TABLE_NAME['message'][$chat->getRoomType()])
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame($currentRoom['recordId'], self::$listId[0]);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame($userName, $message['user_name']);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertIsInt
Open
$this->assertIsInt($row['last_message'], 'Problem with methods "addToFavorites"');
- Exclude checks
Call to method getCurrentUserModel
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$groups = \App\User::getCurrentUserModel()->getGroupNames();
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame($_SESSION['chat']['recordId'], self::$globalRoom['global_room_id']);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
- Exclude checks
Call to method getInstance
from undeclared class \App\Chat
Open
$chat = \App\Chat::getInstance();
- Exclude checks
Reference to constant COLUMN_NAME
from undeclared class \App\Chat
Open
$this->assertSame($recordModel->getId(), $rowRoom[\App\Chat::COLUMN_NAME['room']['crm']]);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame($recordModel->getId(), $rowRoom[\App\Chat::COLUMN_NAME['room']['crm']]);
- Exclude checks
Call to method getRoomsByUser
from undeclared class \App\Chat
Open
$rooms = \App\Chat::getRoomsByUser();
- Exclude checks
Call to method getInstance
from undeclared class \App\Chat
Open
$chat = \App\Chat::getInstance('crm', $recordModel->getId());
- Exclude checks
Call to method getCurrentUserModel
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$this->assertSame(\App\User::getCurrentUserModel()->getName(), $entries[$key]['user_name']);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame($_SESSION['chat']['roomType'], 'crm');
- Exclude checks
Call to method getCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame(\App\User::getCurrentUserModel()->getName(), $entries[$key]['user_name']);
- Exclude checks
Call to method isNewMessagesForCrm
from undeclared class \App\Chat
Open
$this->assertFalse(\App\Chat::isNewMessagesForCrm($userId), 'Problem with the method "isNewMessagesForCrm"');
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertIsInt
Open
$this->assertIsInt($id);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
Open
$this->assertNotFalse(self::$globalRoom, 'The general chat room not exists.');
- Exclude checks
Call to method getInstance
from undeclared class \App\Chat
Open
$chat = \App\Chat::getInstance('group', $groupId);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertTrue
Open
$this->assertTrue($chat->isRoomExists(), "The chat room does not exist '{$groups[$groupId]}'");
- Exclude checks
Call to method setCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
\App\User::setCurrentUserId(self::$users[1]);
- Exclude checks
Call to method getCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
->where(['userid' => \App\User::getCurrentUserId()])
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame($rowMsg['messages'], $entries[$key]['messages']);
- Exclude checks
Reference to constant COLUMN_NAME
from undeclared class \App\Chat
Open
->where([\App\Chat::COLUMN_NAME['room']['crm'] => $recordModel->getId()])->one();
- Exclude checks
Call to method setCurrentRoom
from undeclared class \App\Chat
Open
\App\Chat::setCurrentRoom('crm', self::$listId[0]);
- Exclude checks
Call to method getInstance
from undeclared class \App\Chat
Open
$chat = \App\Chat::getInstance('global', self::$globalRoom['global_room_id']);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertNotNull
Open
$this->assertNotNull($message['messages']);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertFalse
Open
$this->assertFalse(
- Exclude checks
Argument 1 (moduleName)
is 'Chat'
but \Settings_ModuleManager_Module_Model::disableModule()
takes \type
defined at /code/modules/Settings/ModuleManager/models/Module.php:110
Open
(new \Settings_ModuleManager_Module_Model())->disableModule('Chat');
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$this->assertFalse((new \App\Db\Query())
- Exclude checks
Call to method setCurrentRoom
from undeclared class \App\Chat
Open
\App\Chat::setCurrentRoom('global', self::$globalRoom['global_room_id']);
- Exclude checks
Call to method getInstance
from undeclared class \App\Chat
Open
$chat = \App\Chat::getInstance();
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertTrue
Open
$this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- Exclude checks
Call to method setCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
\App\User::setCurrentUserId(self::$users[0]);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
Open
$this->assertNotFalse($key, 'Problem with the method "getRoomsByUser". Crm id=' . $recordModel->getId());
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$rowMsg = (new \App\Db\Query())
- Exclude checks
Call to method getInstance
from undeclared class \App\Chat
Open
$chat = \App\Chat::getInstance('crm', self::$listId[0]);
- Exclude checks
Call to method getCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame($_SESSION['chat']['roomType'], 'crm');
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
Open
$this->assertNotFalse($row, 'Problem with methods "addToFavorites"');
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame($userId, $message['userid']);
- Exclude checks
Call to method isNewMessages
from undeclared class \App\Chat
Open
$this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertIsArray
Open
$this->assertIsArray($globalGroup);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertIsInt
Open
$this->assertIsInt($id);
- Exclude checks
Reference to constant COLUMN_NAME
from undeclared class \App\Chat
Open
->where([\App\Chat::COLUMN_NAME['room']['crm'] => $recordId])->exists(),
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
Open
$this->assertNotFalse($rowMsg, "The message {$id} does not exist");
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertFalse
Open
$this->assertFalse(
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame('test2', $rowMsg['messages']);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame($rowMsg['messages'], $entries[$key]['messages']);
- Exclude checks
Call to method getActiveAdminId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$userId = \App\User::getActiveAdminId();
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame($_SESSION['chat']['recordId'], self::$listId[0]);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertTrue
Open
$this->assertTrue($chat->isAssigned(), "The user should be assigned '{$groups[$groupId]}'");
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertFalse
Open
$this->assertFalse($chat->isAssigned(), "The user should not be assigned '{$groups[$groupId]}'");
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$rowMsg = (new \App\Db\Query())
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
Open
$this->assertNotFalse($key, 'Problem with the method "getEntries"');
- Exclude checks
Call to method isNewMessages
from undeclared class \App\Chat
Open
$this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- Exclude checks
Call to method getCurrentUserModel
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$userName = \App\User::getCurrentUserModel()->getName();
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertIsArray
Open
$this->assertIsArray($globalCrm);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame($userName, $message['user_name']);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame($userName, $message['user_name']);
- Exclude checks
Reference to constant TABLE_NAME
from undeclared class \App\Chat
Open
->from(\App\Chat::TABLE_NAME['room']['crm'])
- Exclude checks
Reference to constant TABLE_NAME
from undeclared class \App\Chat
Open
->from(\App\Chat::TABLE_NAME['message']['crm'])
- Exclude checks
Reference to constant TABLE_NAME
from undeclared class \App\Chat
Open
->from(\App\Chat::TABLE_NAME['room'][$chat->getRoomType()])
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame($_SESSION['chat']['roomType'], 'global');
- Exclude checks
Call to method getCurrentUserModel
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$this->assertSame(\App\User::getCurrentUserModel()->getName(), $entries[$key]['user_name']);
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$rowRoom = (new \App\Db\Query())
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
Open
$this->assertNotFalse($key, 'Problem with the method "getEntries"');
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
Open
$this->assertNotFalse($rowMsg, "The message {$id} does not exist");
- Exclude checks
Call to method getCurrentRoom
from undeclared class \App\Chat
Open
$currentRoom = \App\Chat::getCurrentRoom();
- Exclude checks
Call to method getActiveAdminId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
\App\User::setCurrentUserId(\App\User::getActiveAdminId());
- Exclude checks
Call to method getCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
->where(['userid' => \App\User::getCurrentUserId()])
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertFalse
Open
$this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
Open
$this->assertNotFalse($rowRoom, "The chat room {$recordModel->getId()} does not exist");
- Exclude checks
Reference to constant TABLE_NAME
from undeclared class \App\Chat
Open
->from(\App\Chat::TABLE_NAME['message'][$chat->getRoomType()])
- Exclude checks
Call to method setCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
\App\User::setCurrentUserId($userId);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertFalse
Open
$this->assertFalse(\App\Chat::isNewMessagesForCrm($userId), 'Problem with the method "isNewMessagesForCrm"');
- Exclude checks
Reference to constant COLUMN_NAME
from undeclared class \App\Chat
Open
->andWhere([\App\Chat::COLUMN_NAME['room'][$chat->getRoomType()] => $groupId])
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
Open
$this->assertNotFalse($rowMsg, "The message {$id} does not exist");
- Exclude checks
Call to method isNewMessages
from undeclared class \App\Chat
Open
$this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame($recordModel->getId(), $chat->getRecordId());
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame($currentRoom['roomType'], 'crm');
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
(new \App\Db\Query())
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertTrue
Open
$this->assertTrue($chat->isRoomExists(), "The chat room does not exist '{$groups[$groupId]}'");
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame(\App\User::getCurrentUserModel()->getName(), $entries[$key]['user_name']);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertFalse
Open
$this->assertFalse(\App\Chat::isNewMessagesForCrm($userId), 'Problem with the method "isNewMessagesForCrm"');
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertIsArray
Open
$this->assertIsArray($globalHistory);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame($userId, $message['userid']);
- Exclude checks
Reference to constant TABLE_NAME
from undeclared class \App\Chat
Open
->from(\App\Chat::TABLE_NAME['message'][$chat->getRoomType()])
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame('test', $rowMsg['messages']);
- Exclude checks
Call to method isNewMessages
from undeclared class \App\Chat
Open
$this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- Exclude checks
Call to method isNewMessagesForCrm
from undeclared class \App\Chat
Open
$this->assertFalse(\App\Chat::isNewMessagesForCrm($userId), 'Problem with the method "isNewMessagesForCrm"');
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
- Exclude checks
Call to method getCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$userId = \App\User::getCurrentUserId();
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame($_SESSION['chat']['recordId'], self::$listId[0]);
- Exclude checks
Call to method isNewMessages
from undeclared class \App\Chat
Open
$this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- Exclude checks
Call to method isNewMessages
from undeclared class \App\Chat
Open
$this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- Exclude checks
Call to method getInstance
from undeclared class \App\Chat
Open
$chat = \App\Chat::getInstance();
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertFalse
Open
$this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- Exclude checks
Reference to constant TABLE_NAME
from undeclared class \App\Chat
Open
->from(\App\Chat::TABLE_NAME['room']['crm'])
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame($recordModel->getModuleName(), $rooms['crm'][$key]['moduleName']);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame($recordModel->getId(), $rooms['crm'][$key]['recordid']);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
- Exclude checks
Call to method getCurrentRoom
from undeclared class \App\Chat
Open
$currentRoom = \App\Chat::getCurrentRoom();
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertNotNull
Open
$this->assertNotNull($message['messages']);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame($userId, $message['userid']);
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
(new \App\Db\Query())
- Exclude checks
Reference to constant COLUMN_NAME
from undeclared class \App\Chat
Open
->andWhere([\App\Chat::COLUMN_NAME['room'][$chat->getRoomType()] => $groupId])
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertFalse
Open
$this->assertFalse((new \App\Db\Query())
- Exclude checks
Call to method getCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertTrue
Open
$this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertNotNull
Open
$this->assertNotNull($message['messages']);
- Exclude checks
Reference to constant COLUMN_NAME
from undeclared class \App\Chat
Open
->where([\App\Chat::COLUMN_NAME['message']['crm'] => $recordId])->exists(),
- Exclude checks
Call to method setCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
\App\User::setCurrentUserId(\App\User::getActiveAdminId());
- Exclude checks
@throws type of testRemoveFromFavorites
has undeclared type \yii\db\Exception
(Did you mean class \Exception) Open
public function testRemoveFromFavorites()
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertIsInt
Open
$this->assertIsInt($id);
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$rowMsg = (new \App\Db\Query())
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertSame
Open
$this->assertSame('testRoomCrm', $rowMsg['messages']);
- Exclude checks
Call to undeclared method \Tests\Base\Z_Chat::assertFalse
Open
$this->assertFalse(\App\Record::isExists(self::$listId[0]), 'The record should not exist');
- Exclude checks
Avoid variables with short names like $id. Configured minimum length is 3. Open
$id = $chat->addMessage('Test MSG');
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $id. Configured minimum length is 3. Open
$id = $chat->addMessage('test');
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
The class Z_Chat is not named in CamelCase. Open
class Z_Chat extends \Tests\Base
{
/**
* ID list.
*
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
Avoid variables with short names like $id. Configured minimum length is 3. Open
private static function getKeyMessage($entries, int $id)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $id. Configured minimum length is 3. Open
$id = $chat->addMessage('test2');
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $id. Configured minimum length is 3. Open
$id = $chat->addMessage('testRoomCrm');
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Spaces must be used to indent lines; tabs are not allowed Open
* Is chat active.
- 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
* @codeCoverageIgnore
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($userRooms[$roomType] as $key => $val) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$users[] = A_User::createUsersRecord('test_1')->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
*
- 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 int|false
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $userId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($val['user_id'] === $userId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var int[]
- 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 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
* @param int $id
- 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
foreach ($participants as $key => $val) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$listId[] = $recordModel->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
private static $users = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $userRooms
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = C_RecordActions::createContactRecord(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testConfiguration()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private static $listId;
- 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 function getUserFromParticipants($participants, int $userId)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $key;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertTrue(\App\Module::isModuleActive('Chat'), 'The chat module is inactive');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Check if the general chat room exists.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var bool|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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($entries as $key => $val) {
- 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var bool
- 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
* @param string $roomType
- 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
* Configuration testing.
- 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
* @var int[]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($val['recordid'] === $recordId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $key;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get key of message.
- 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
* @codeCoverageIgnore
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function setUpBeforeClass(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\User::setCurrentUserId(\App\User::getActiveAdminId());
- 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 testGeneralRoom()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $key;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get user from participants.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* ID list.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
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
* @return bool|int
- 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 function getKeyMessage($entries, int $id)
- 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 $globalRoom = 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
* Get key of chat room.
- 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::$chatActive = \App\Module::isModuleActive('Chat');
- 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->assertIsInt($id);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$entries = $chat->getEntries();
- 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
$chat = \App\Chat::getInstance();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private static $chatActive = 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
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($val['id'] === $id) {
- 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
* Setting of tests.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$users[] = A_User::createUsersRecord('test_2')->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
}
- 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testRemoveFromFavorites()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Chat::setCurrentRoom('global', self::$globalRoom['global_room_id']);
- 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 testAddNewMessage()
- 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 creating a chat room.
- 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
->from(\App\Chat::TABLE_NAME['message'][$chat->getRoomType()])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->andWhere([\App\Chat::COLUMN_NAME['room'][$chat->getRoomType()] => $groupId])
- 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($rowMsg['messages'], $entries[$key]['messages']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testNewMessage()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$chat->getEntries();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* List of user IDs.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private static function getKeyRoom($userRooms, string $roomType, int $recordId)
- 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
* @param array $entries
- 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
* @param array $participants
- 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
$groupId = \key($groups);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(\App\User::getCurrentUserModel()->getName(), $entries[$key]['user_name']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Remove test from favorites.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertTrue($chat->isRoomExists(), "The chat room does not exist '{$groups[$groupId]}'");
- 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->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotFalse($rowMsg, "The message {$id} does not exist");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$groups = \App\User::getCurrentUserModel()->getGroupNames();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertFalse($chat->isAssigned(), "The user should not be assigned '{$groups[$groupId]}'");
- 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
$groupId = \key($groups);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$chat->removeFromFavorites();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertFalse((new \App\Db\Query())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where(['userid' => \App\User::getCurrentUserId()])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Testing adding messages.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$rowMsg = (new \App\Db\Query())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\User::setCurrentUserId(self::$users[0]);
- 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
// $chat = \App\Chat::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
$this->assertNotFalse(self::$globalRoom, 'The general chat room not exists.');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertGreaterThanOrEqual(1, \count($groups), 'No defined groups');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertCount($cntEntries + 1, $entries, 'Too many messages in the chat room');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where(['id' => $id])->one();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$chat = \App\Chat::getInstance('group', $groupId);
- 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\User::getCurrentUserId(), $rowMsg['userid']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \App\Exceptions\IllegalValue
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$chat->addMessage('test 2');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$groupId = \key($groups);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$chat = \App\Chat::getInstance('group', $groupId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testCreatingChatRoomCrm()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertFalse($chat->isAssigned(), "The user should not be assigned '{$groups[$groupId]}'");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$chat = \App\Chat::createRoom('crm', $recordModel->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
$id = $chat->addMessage('test');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotFalse($rowMsg, "The message {$id} does not exist");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Switch user
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$rowRoom = (new \App\Db\Query())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->from(\App\Chat::TABLE_NAME['room']['crm'])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//$this->assertSame($currentRoom['recordId'], self::$globalRoom['global_room_id']); ???
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$cntEntries = \count($chat->getEntries());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$id = $chat->addMessage('Test MSG');
- 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 the method of the current chat room.
- 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
->where(['id' => $id])->one();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(\App\User::getCurrentUserModel()->getName(), $entries[$key]['user_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
self::$globalRoom = (new \App\Db\Query())->from('u_#__chat_global')->where(['name' => 'LBL_GENERAL'])->one();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//$this->assertSame($chat->getRecordId(), self::$globalRoom['global_room_id']); ???
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testGroup()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\User::setCurrentUserId(\App\User::getActiveAdminId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertFalse($chat->isAssigned(), "The user should not be assigned '{$groups[$groupId]}'");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('Test MSG', $rowMsg['messages']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotFalse($key, 'Problem with the method "getEntries"');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\User::setCurrentUserId(\App\User::getActiveAdminId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->andWhere([\App\Chat::COLUMN_NAME['room'][$chat->getRoomType()] => $groupId])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$chat = \App\Chat::getInstance();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertIsInt($id);
- 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
//Switch user
- 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
* Global room.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $recordId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($userRooms[$roomType]) && \is_array($userRooms[$roomType])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @codeCoverageIgnore
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool|int|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
//$currentRoom = \App\Chat::getCurrentRoom(); ???
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertTrue($chat->isRoomExists(), "The chat room does not exist '{$groups[$groupId]}'");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = \Vtiger_Record_Model::getInstanceById(self::$listId[0]);
- 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->assertTrue($chat->isRoomExists(), "The chat room does not exist '{$groups[$groupId]}'");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where(['userid' => \App\User::getCurrentUserId()])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$groups = \App\User::getCurrentUserModel()->getGroupNames();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->from(\App\Chat::TABLE_NAME['message'][$chat->getRoomType()])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$entries = $chat->getEntries();
- 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
$chat->getEntries();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//$this->assertSame($chat->getRoomType(), 'global'); ???
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$groups = \App\User::getCurrentUserModel()->getGroupNames();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Test assigning a user to a group room.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotFalse($row, 'Problem with methods "addToFavorites"');
- 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('test', $rowMsg['messages']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Testing the method for checking new messages.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Chat testing for groups.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$chat = \App\Chat::getInstance('group', $groupId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$rowMsg = (new \App\Db\Query())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$key = self::getKeyMessage($entries, $id);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$chat->addToFavorites();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertIsInt($row['last_message'], 'Problem with methods "addToFavorites"');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->exists(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($_SESSION['chat']['roomType'], 'global');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotFalse($key, 'Problem with the method "getEntries"');
- 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 testAssigningToGroup()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row = (new \App\Db\Query())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->from(\App\Chat::TABLE_NAME['room'][$chat->getRoomType()])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \yii\db\Exception
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertTrue($chat->isAssigned(), "The user should be assigned '{$groups[$groupId]}'");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertTrue($chat->isRoomExists(), "The chat room does not exist '{$groups[$groupId]}'");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($_SESSION);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$chat = \App\Chat::getInstance();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotFalse($rowRoom, "The chat room {$recordModel->getId()} does not exist");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//$this->assertSame($currentRoom['roomType'], 'global'); ???
- 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->assertTrue($chat->isRoomExists(), "The chat room does not exist '{$groups[$groupId]}'");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \App\Exceptions\IllegalValue
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->from(\App\Chat::TABLE_NAME['room'][$chat->getRoomType()])
- 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 testCurrentRoom()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$key = self::getKeyMessage($entries, $id);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$chat = \App\Chat::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
$this->assertSame($rowMsg['messages'], $entries[$key]['messages']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertTrue($chat->isAssigned(), "The user should be assigned '{$groups[$groupId]}'");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->one();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Problem with methods "removeFromFavorites"'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($_SESSION['chat']['recordId'], self::$globalRoom['global_room_id']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\User::setCurrentUserId(self::$users[1]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where([\App\Chat::COLUMN_NAME['room']['crm'] => $recordModel->getId()])->one();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$key = self::getKeyRoom($rooms, 'crm', (int) $recordModel->getId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(\App\User::getCurrentUserModel()->getName(), $entries[$key]['user_name']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($globalHistory as $message) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($globalGroup as $message) {
- 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
->where([\App\Chat::COLUMN_NAME['message']['crm'] => $recordId])->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 testCurrentRoomAfterDeletingRecord(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$id = $chat->addMessage('test2');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame('test2', $rowMsg['messages']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertFalse(\App\Chat::isNewMessagesForCrm($userId), 'Problem with the method "isNewMessagesForCrm"');
- 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 testSwitchRoom()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Chat::setCurrentRoom('crm', self::$listId[0]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertIsArray($globalCrm);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($globalCrm as $message) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotFalse($key, 'Problem with the method "getRoomsByUser". Crm id=' . $recordModel->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
}
- 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
* @throws \App\Exceptions\IllegalValue
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($userName, $message['user_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
$this->assertSame($userName, $message['user_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
$this->assertSame($recordModel->getModuleName(), $rooms['crm'][$key]['moduleName']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$chat->addToFavorites();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotNull($message['messages']);
- 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
$rooms = \App\Chat::getRoomsByUser();
- 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 testAddMessageCrm()
- 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('testRoomCrm', $rowMsg['messages']);
- 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
* @throws \Exception
- 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
if (!self::$chatActive) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($recordModel->getId(), $chat->getRecordId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Testing adding messages to Crm chat room.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotFalse($key, 'Problem with the method "getEntries"');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\User::setCurrentUserId($userId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$chat = \App\Chat::getInstance('crm', self::$listId[0]);
- 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($_SESSION['chat']['recordId'], self::$listId[0]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$globalGroup = $chat->getHistoryByType('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->assertFalse(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = \Vtiger_Record_Model::getInstanceById(self::$listId[0]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userId = \App\User::getActiveAdminId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($currentRoom['recordId'], self::$listId[0]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Message history test.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$globalHistory = $chat->getHistoryByType('global');
- 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
\App\User::setCurrentUserId(\App\User::getActiveAdminId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$rowMsg = (new \App\Db\Query())
- 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->assertIsInt($id);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \App\Exceptions\IllegalValue
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$currentRoom = \App\Chat::getCurrentRoom();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$chat = \App\Chat::getInstance('global', self::$globalRoom['global_room_id']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($userId, $message['userid']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($userId, $message['userid']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($userId, $message['userid']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testRemoveRecordCrm(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
(new \App\Db\Query())
- 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
$currentRoom = \App\Chat::getCurrentRoom();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (self::$listId as $id) {
- 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->assertIsInt($id);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->from(\App\Chat::TABLE_NAME['room']['crm'])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//$this->assertSame($currentRoom['recordId'], self::$globalRoom['global_room_id']); ???
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
"Messages {$recordId} exist"
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Test the current chat room after deleting the record.
- 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
->where(['id' => $id])->one();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$key = self::getKeyMessage($entries, $id);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Testing a CRM chat room.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userId = \App\User::getCurrentUserId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($userName, $message['user_name']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordId = $recordModel->getId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where([\App\Chat::COLUMN_NAME['room']['crm'] => $recordId])->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
$this->assertFalse(
- 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
->from(\App\Chat::TABLE_NAME['message'][$chat->getRoomType()])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotFalse($rowMsg, "The message {$id} does not exist");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
- 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($recordModel->getId(), $rowRoom[\App\Chat::COLUMN_NAME['room']['crm']]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($recordModel->getId(), $rooms['crm'][$key]['recordid']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$chat = \App\Chat::getInstance('crm', $recordModel->getId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$rowMsg = (new \App\Db\Query())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($rowMsg['messages'], $entries[$key]['messages']);
- 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
$userName = \App\User::getCurrentUserModel()->getName();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testRoomCrm()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotNull($message['messages']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->from(\App\Chat::TABLE_NAME['message'][$chat->getRoomType()])
- 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 the removal of Crm chat room.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertIsArray($globalGroup);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
(new \App\Db\Query())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->delete();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
"The chat room {$recordId} does exist"
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @codeCoverageIgnore
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($_SESSION['chat']['roomType'], 'crm');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset(self::$listId[0]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->delete();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertFalse(\App\Chat::isNewMessagesForCrm($userId), 'Problem with the method "isNewMessagesForCrm"');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where(['id' => $id])->one();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
- 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($_SESSION['chat']['roomType'], 'crm');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->from(\App\Chat::TABLE_NAME['message']['crm'])
- 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
(new \Settings_ModuleManager_Module_Model())->disableModule('Chat');
- 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($currentRoom['roomType'], 'crm');
- 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($globalHistory);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertFalse(\App\Record::isExists(self::$listId[0]), 'The record should not exist');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//$this->assertSame($currentRoom['roomType'], 'global'); ???
- 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
$recordModel = \Vtiger_Record_Model::getInstanceById($id);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$entries = $chat->getEntries();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$id = $chat->addMessage('testRoomCrm');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotFalse($rowMsg, "The message {$id} does not exist");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Chat room switching 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
public function testHistory()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$globalCrm = $chat->getHistoryByType('crm');
- 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->assertNotNull($message['messages']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = \Vtiger_Record_Model::getInstanceById(self::$listId[0]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertSame($_SESSION['chat']['recordId'], self::$listId[0]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\vtlib\Functions::clearCacheMetaDataRecord(self::$listId[0]);
- Exclude checks
Class name "Z_Chat" is not in camel caps format Open
class Z_Chat extends \Tests\Base
- Exclude checks
Opening parenthesis of a multi-line function call must be the last content on the line Open
$this->assertFalse((new \App\Db\Query())
- Exclude checks