YetiForceCompany/YetiForceCRM

View on GitHub
tests/Settings/CustomView.php

Summary

Maintainability
A
2 hrs
Test Coverage
A
100%

Method testModuleModel has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testModuleModel()
    {
        $moduleModel = \Settings_CustomView_Module_Model::getInstance('Settings:CustomView');
        $cvsData = \App\CustomView::getFiltersByModule('Leads');
        $this->assertIsArray($cvsData, 'Custom views list should be array type');
Severity: Major
Found in tests/Settings/CustomView.php - About 2 hrs to fix

    Missing class import via use statement (line '85', column '27').
    Open

            $this->assertEmpty((new \App\Db\Query())->select(['cvid'])->from('vtiger_customview')->where(['cvid' => $newCvid])->scalar(), 'New CustomView should be removed');
    Severity: Minor
    Found in tests/Settings/CustomView.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

    Missing class import via use statement (line '81', column '24').
    Open

            $leadsDefCvid = (new \App\Db\Query())->select(['cvid'])->from('vtiger_customview')->where(['entitytype' => 'Leads', 'setdefault' => 1])->scalar();
    Severity: Minor
    Found in tests/Settings/CustomView.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

    Avoid using static access to class '\Settings_CustomView_Module_Model' in method 'testModuleModel'.
    Open

            $moduleModel = \Settings_CustomView_Module_Model::getInstance('Settings:CustomView');
    Severity: Minor
    Found in tests/Settings/CustomView.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

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

    Avoid using static access to class '\CustomView_Record_Model' in method 'testModuleModel'.
    Open

            $recordModel = \CustomView_Record_Model::getInstanceById($cvData['cvid']);
    Severity: Minor
    Found in tests/Settings/CustomView.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

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

    Avoid using static access to class '\Settings_CustomView_Module_Model' in method 'testModuleModel'.
    Open

            $supportedModules = \Settings_CustomView_Module_Model::getSupportedModules();
    Severity: Minor
    Found in tests/Settings/CustomView.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

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

    Avoid using static access to class '\CustomView_Record_Model' in method 'testModuleModel'.
    Open

            $newCustomViewModel = \CustomView_Record_Model::getCleanInstance();
    Severity: Minor
    Found in tests/Settings/CustomView.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

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

    Avoid using static access to class '\App\Module' in method 'testModuleModel'.
    Open

            $this->assertSame($supportedModules[\App\Module::getModuleId('Leads')], 'Leads', 'Module mapping mismatch');
    Severity: Minor
    Found in tests/Settings/CustomView.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

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

    Avoid using static access to class '\App\CustomView' in method 'testModuleModel'.
    Open

            $cvsData = \App\CustomView::getFiltersByModule('Leads');
    Severity: Minor
    Found in tests/Settings/CustomView.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

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

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

            $user = 'Users:' . \App\User::getActiveAdminId();
    Severity: Minor
    Found in tests/Settings/CustomView.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

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

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

            $this->assertIsArray($moduleModel->getFilterPermissionsView($recordModel->getId(), 'default'), 'Custom view permissions list(default) should be array type');
    Severity: Critical
    Found in tests/Settings/CustomView.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

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

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

                'setdefault' => 0,
    Severity: Critical
    Found in tests/Settings/CustomView.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

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

    Define a constant instead of duplicating this literal "featured" 5 times.
    Open

            $this->assertIsArray($moduleModel->getFilterPermissionsView($recordModel->getId(), 'featured'), 'Custom view permissions list(featured) should be array type');
    Severity: Critical
    Found in tests/Settings/CustomView.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

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

    Define a constant instead of duplicating this literal "Leads" 9 times.
    Open

            $cvsData = \App\CustomView::getFiltersByModule('Leads');
    Severity: Critical
    Found in tests/Settings/CustomView.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

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

    Call to undeclared method \Tests\Settings\CustomView::assertIsArray
    Open

            $this->assertIsArray($moduleModel->getFilterPermissionsView($recordModel->getId(), 'default'), 'Custom view permissions list(default) should be array type');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \Tests\Settings\CustomView::assertNotEmpty
    Open

            $this->assertNotEmpty($cvData, 'Leads custom view record should contain data');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \Tests\Settings\CustomView::assertEmpty
    Open

            $this->assertEmpty($moduleModel->getFilterPermissionsView($recordModel->getId(), 'default'), 'Custom view permissions list(default) should be empty');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \Tests\Settings\CustomView::assertNotNull
    Open

            $this->assertNotNull($newCvid, 'Expected cvid');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \Tests\Settings\CustomView::assertEmpty
    Open

            $this->assertEmpty($moduleModel->getFilterPermissionsView($recordModel->getId(), 'default'), 'Custom view permissions list(default) should be emptied');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \Tests\Settings\CustomView::assertSame
    Open

            $this->assertSame($supportedModules[\App\Module::getModuleId('Leads')], 'Leads', 'Module mapping mismatch');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \Tests\Settings\CustomView::assertEmpty
    Open

            $this->assertEmpty($moduleModel->getFilterPermissionsView($recordModel->getId(), 'featured'), 'Custom view permissions list(featured) should be empty');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \Tests\Settings\CustomView::assertSame
    Open

            $this->assertSame('index.php?module=CustomView&parent=Settings&view=FilterPermissions&type=featured&sourceModule=Leads&cvid=115', $moduleModel->getFeaturedFilterUrl('Leads', 115), 'Generated featured filter url mismatch');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \Tests\Settings\CustomView::assertSame
    Open

            $this->assertSame($newCustomViewModel->getId(), $leadsDefCvid, 'Default cvid for module Leads mismatch');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \Tests\Settings\CustomView::assertIsArray
    Open

            $this->assertIsArray($moduleModel->getFilterPermissionsView($recordModel->getId(), 'featured'), 'Custom view permissions list(featured) should be array type');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \Tests\Settings\CustomView::assertSame
    Open

            $this->assertSame('index.php?module=CustomView&view=EditAjax&source_module=Leads&record=115', $moduleModel->getUrlToEdit('Leads', 115), 'Generated edit url mismatch');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \App\Db\Query::select
    Open

            $this->assertEmpty((new \App\Db\Query())->select(['cvid'])->from('vtiger_customview')->where(['cvid' => $newCvid])->scalar(), 'New CustomView should be removed');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \Tests\Settings\CustomView::assertIsArray
    Open

            $this->assertIsArray($cvsData, 'Custom views list should be array type');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \Tests\Settings\CustomView::assertNotEmpty
    Open

            $this->assertNotEmpty($filterPermsView, 'Custom view permissions list(default) should be not empty');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \Tests\Settings\CustomView::assertSame
    Open

            $this->assertSame('index.php?module=CustomView&parent=Settings&view=FilterPermissions&type=default&sourceModule=Leads&cvid=115&isDefault=1', $moduleModel->getUrlDefaultUsers('Leads', 115, 1), 'Generated default users url mismatch');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \Tests\Settings\CustomView::assertSame
    Open

            $this->assertSame('index.php?module=CustomView&view=EditAjax&source_module=Leads', $moduleModel->getCreateFilterUrl('Leads'), 'Generated create filter url mismatch');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \Tests\Settings\CustomView::assertEmpty
    Open

            $this->assertEmpty($moduleModel->getFilterPermissionsView($recordModel->getId(), 'featured'), 'Custom view permissions list(featured) should be empty');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \App\Db\Query::select
    Open

            $leadsDefCvid = (new \App\Db\Query())->select(['cvid'])->from('vtiger_customview')->where(['entitytype' => 'Leads', 'setdefault' => 1])->scalar();
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \Tests\Settings\CustomView::assertEmpty
    Open

            $this->assertEmpty((new \App\Db\Query())->select(['cvid'])->from('vtiger_customview')->where(['cvid' => $newCvid])->scalar(), 'New CustomView should be removed');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \Tests\Settings\CustomView::assertTrue
    Open

            $this->assertTrue($filterPermsFound, 'Created default users filter view entry not found');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \Tests\Settings\CustomView::assertNotEmpty
    Open

            $this->assertNotEmpty($supportedModules, 'System should have any custom view supported modules');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \Tests\Settings\CustomView::assertNotEmpty
    Open

            $this->assertNotEmpty($cvsData, 'Leads module should contain views');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

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

            $user = 'Users:' . \App\User::getActiveAdminId();
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

    Call to undeclared method \Tests\Settings\CustomView::assertNotEmpty
    Open

            $this->assertNotEmpty($moduleModel->getFilterPermissionsView($recordModel->getId(), 'featured'), 'Custom view permissions list(featured) should be not empty');
    Severity: Critical
    Found in tests/Settings/CustomView.php by phan

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

         */

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

            $cvData = \array_pop($cvsData);

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

            $user = 'Users:' . \App\User::getActiveAdminId();

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

            $this->assertEmpty($moduleModel->getFilterPermissionsView($recordModel->getId(), 'featured'), 'Custom view permissions list(featured) should be empty');

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

            $newCustomViewModel = \CustomView_Record_Model::getCleanInstance();

    Line exceeds 120 characters; contains 170 characters
    Open

            $this->assertEmpty((new \App\Db\Query())->select(['cvid'])->from('vtiger_customview')->where(['cvid' => $newCvid])->scalar(), 'New CustomView should be removed');

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

            $this->assertSame('index.php?module=CustomView&view=EditAjax&source_module=Leads&record=115', $moduleModel->getUrlToEdit('Leads', 115), 'Generated edit url mismatch');

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

                'status' => 0,

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

            $newCustomViewModel->save();

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

            $this->assertSame('index.php?module=CustomView&parent=Settings&view=FilterPermissions&type=featured&sourceModule=Leads&cvid=115', $moduleModel->getFeaturedFilterUrl('Leads', 115), 'Generated featured filter url mismatch');

    Line exceeds 120 characters; contains 167 characters
    Open

            $this->assertIsArray($moduleModel->getFilterPermissionsView($recordModel->getId(), 'featured'), 'Custom view permissions list(featured) should be array type');

    Line exceeds 120 characters; contains 230 characters
    Open

            $this->assertSame('index.php?module=CustomView&parent=Settings&view=FilterPermissions&type=featured&sourceModule=Leads&cvid=115', $moduleModel->getFeaturedFilterUrl('Leads', 115), 'Generated featured filter url mismatch');

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

            $newCustomViewModel->setModule('Leads');

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

            $newCustomViewModel->save();

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

            $this->assertEmpty((new \App\Db\Query())->select(['cvid'])->from('vtiger_customview')->where(['cvid' => $newCvid])->scalar(), 'New CustomView should be removed');

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

            $recordModel = \CustomView_Record_Model::getInstanceById($cvData['cvid']);

    Line exceeds 120 characters; contains 165 characters
    Open

            $this->assertIsArray($moduleModel->getFilterPermissionsView($recordModel->getId(), 'default'), 'Custom view permissions list(default) should be array type');

    Line exceeds 120 characters; contains 158 characters
    Open

            $this->assertEmpty($moduleModel->getFilterPermissionsView($recordModel->getId(), 'default'), 'Custom view permissions list(default) should be empty');

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

            $recordModel->setDefaultForMember($user);

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

            foreach ($filterPermsView as $val) {

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

            $this->assertEmpty($moduleModel->getFilterPermissionsView($recordModel->getId(), 'default'), 'Custom view permissions list(default) should be emptied');

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

            $this->assertIsArray($moduleModel->getFilterPermissionsView($recordModel->getId(), 'featured'), 'Custom view permissions list(featured) should be array type');

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

            $supportedModules = \Settings_CustomView_Module_Model::getSupportedModules();

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

            $this->assertNotEmpty($supportedModules, 'System should have any custom view supported modules');

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

            $leadsDefCvid = (new \App\Db\Query())->select(['cvid'])->from('vtiger_customview')->where(['entitytype' => 'Leads', 'setdefault' => 1])->scalar();

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

            \CustomView_Record_Model::getInstanceById($newCvid)->delete();

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

            $moduleModel = \Settings_CustomView_Module_Model::getInstance('Settings:CustomView');

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

            $this->assertNotEmpty($cvsData, 'Leads module should contain views');

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

            $this->assertNotEmpty($filterPermsView, 'Custom view permissions list(default) should be not empty');

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

            }

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

                if (\in_array($user, $val)) {

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

            $this->assertTrue($filterPermsFound, 'Created default users filter view entry not found');

    Line exceeds 120 characters; contains 160 characters
    Open

            $this->assertEmpty($moduleModel->getFilterPermissionsView($recordModel->getId(), 'featured'), 'Custom view permissions list(featured) should be empty');

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

            $recordModel->removeDefaultForMember($user);

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

            $this->assertSame($supportedModules[\App\Module::getModuleId('Leads')], 'Leads', 'Module mapping mismatch');

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

            $this->assertSame('index.php?module=CustomView&parent=Settings&view=FilterPermissions&type=default&sourceModule=Leads&cvid=115&isDefault=1', $moduleModel->getUrlDefaultUsers('Leads', 115, 1), 'Generated default users url mismatch');

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

            $recordModel->removeFeaturedForMember($user);

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

                'featured' => 0,

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

            ];

    Line exceeds 120 characters; contains 127 characters
    Open

                'columnslist' => array_keys(\CustomView_Record_Model::getInstanceById($recordModel->getId())->getSelectedFields()),

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

            $newCustomViewModel->set('mode', 'edit');

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

            $this->assertSame($newCustomViewModel->getId(), $leadsDefCvid, 'Default cvid for module Leads mismatch');

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

        {

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

                    $filterPermsFound = true;

    Line exceeds 120 characters; contains 167 characters
    Open

            $this->assertNotEmpty($moduleModel->getFilterPermissionsView($recordModel->getId(), 'featured'), 'Custom view permissions list(featured) should be not empty');

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

                'columnslist' => array_keys(\CustomView_Record_Model::getInstanceById($recordModel->getId())->getSelectedFields()),

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

            $newCustomViewModel->set('setdefault', 1);

    Line exceeds 120 characters; contains 175 characters
    Open

            $this->assertSame('index.php?module=CustomView&view=EditAjax&source_module=Leads&record=115', $moduleModel->getUrlToEdit('Leads', 115), 'Generated edit url mismatch');

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

            $this->assertSame('index.php?module=CustomView&view=EditAjax&source_module=Leads', $moduleModel->getCreateFilterUrl('Leads'), 'Generated create filter url mismatch');

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

                'setdefault' => 0,

    Line exceeds 120 characters; contains 154 characters
    Open

            $leadsDefCvid = (new \App\Db\Query())->select(['cvid'])->from('vtiger_customview')->where(['entitytype' => 'Leads', 'setdefault' => 1])->scalar();

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

        }

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

        /**

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

            $cvsData = \App\CustomView::getFiltersByModule('Leads');

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

            $filterPermsView = $moduleModel->getFilterPermissionsView($recordModel->getId(), 'default');

    Line exceeds 120 characters; contains 174 characters
    Open

            $this->assertSame('index.php?module=CustomView&view=EditAjax&source_module=Leads', $moduleModel->getCreateFilterUrl('Leads'), 'Generated create filter url mismatch');

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

            $customViewData = [

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

            $newCvid = $newCustomViewModel->getId();

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

         * Testing module model.

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

        public function testModuleModel()

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

            $filterPermsFound = false;

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

            $this->assertNotEmpty($moduleModel->getFilterPermissionsView($recordModel->getId(), 'featured'), 'Custom view permissions list(featured) should be not empty');

    Line exceeds 120 characters; contains 240 characters
    Open

            $this->assertSame('index.php?module=CustomView&parent=Settings&view=FilterPermissions&type=default&sourceModule=Leads&cvid=115&isDefault=1', $moduleModel->getUrlDefaultUsers('Leads', 115, 1), 'Generated default users url mismatch');

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

                'description' => 'Record delete test',

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

            $newCustomViewModel->setData($customViewData);

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

            $this->assertNotEmpty($cvData, 'Leads custom view record should contain data');

    Line exceeds 120 characters; contains 160 characters
    Open

            $this->assertEmpty($moduleModel->getFilterPermissionsView($recordModel->getId(), 'default'), 'Custom view permissions list(default) should be emptied');

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

                'viewname' => 'DeleteTest',

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

            $this->assertNotNull($newCvid, 'Expected cvid');

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

            $this->assertIsArray($cvsData, 'Custom views list should be array type');

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

                }

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

            $this->assertEmpty($moduleModel->getFilterPermissionsView($recordModel->getId(), 'featured'), 'Custom view permissions list(featured) should be empty');

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

            $recordModel->setFeaturedForMember($user);

    Line exceeds 120 characters; contains 160 characters
    Open

            $this->assertEmpty($moduleModel->getFilterPermissionsView($recordModel->getId(), 'featured'), 'Custom view permissions list(featured) should be empty');

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

            $this->assertIsArray($moduleModel->getFilterPermissionsView($recordModel->getId(), 'default'), 'Custom view permissions list(default) should be array type');

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

            $this->assertEmpty($moduleModel->getFilterPermissionsView($recordModel->getId(), 'default'), 'Custom view permissions list(default) should be empty');

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

                'setmetrics' => 0,

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

                'color' => '',

    There are no issues that match your filters.

    Category
    Status