YetiForceCompany/YetiForceCRM

View on GitHub
tests/Integrations/ManageConsents.php

Summary

Maintainability
A
2 hrs
Test Coverage
A
100%

Method testGenerateToken has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testGenerateToken(): void
    {
        $moduleName = 'Contacts';
        $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
        if (!($field = current($moduleModel->getFieldsByType('token', true)))) {
Severity: Minor
Found in tests/Integrations/ManageConsents.php - About 1 hr to fix

    Method testAddConfiguration has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function testAddConfiguration(): void
        {
            $app = \Settings_WebserviceApps_Record_Model::getCleanInstance();
            $app->set('type', 'ManageConsents');
            $app->set('status', 1);
    Severity: Minor
    Found in tests/Integrations/ManageConsents.php - About 1 hr to fix

      The class ManageConsents has a coupling between objects value of 19. Consider to reduce the number of dependencies under 13.
      Open

      final class ManageConsents extends \Tests\Base
      {
          use AssertsTrait;
      
          /**
      Severity: Minor
      Found in tests/Integrations/ManageConsents.php by phpmd

      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 '84', column '27').
      Open

              $this->httpClient = new \GuzzleHttp\Client(\App\Utils::merge(\App\RequestHttp::getOptions(), [
      Severity: Minor
      Found in tests/Integrations/ManageConsents.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 '167', column '15').
      Open

              $row = (new \App\Db\Query())->from($user->baseTable)->where(['id' => self::$apiUserId])->one();
      Severity: Minor
      Found in tests/Integrations/ManageConsents.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 '106', column '17').
      Open

                  $field = new \vtlib\Field();
      Severity: Minor
      Found in tests/Integrations/ManageConsents.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 '\Vtiger_Record_Model' in method 'testGenerateToken'.
      Open

              $recordModel = \Vtiger_Record_Model::getCleanInstance('Contacts');
      Severity: Minor
      Found in tests/Integrations/ManageConsents.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\App\Json' in method 'testRecordsList'.
      Open

              $response = \App\Json::decode($body);
      Severity: Minor
      Found in tests/Integrations/ManageConsents.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\App\Fields\ServerAccess' in method 'testAddConfiguration'.
      Open

              $row = \App\Fields\ServerAccess::get(self::$serverId);
      Severity: Minor
      Found in tests/Integrations/ManageConsents.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_WebserviceUsers_Record_Model' in method 'testAddConfiguration'.
      Open

              $user = \Settings_WebserviceUsers_Record_Model::getCleanInstance('ManageConsents');
      Severity: Minor
      Found in tests/Integrations/ManageConsents.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\App\Json' in method 'testAddConsent'.
      Open

              $response = \App\Json::decode($body);
      Severity: Minor
      Found in tests/Integrations/ManageConsents.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\Vtiger_Record_Model' in method 'setUpBeforeClass'.
      Open

              $recordModel = \Vtiger_Record_Model::getCleanInstance('Approvals');
      Severity: Minor
      Found in tests/Integrations/ManageConsents.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\Utils' in method 'testAddConsent'.
      Open

              $request = $this->httpClient->post('ApprovalsRegister/Record', \App\Utils::merge(['json' => [
                  'subject' => 'Text',
                  'approvalsid' => self::$approvalId,
                  'contactid' => self::$recordId,
                  'approvals_register_type' => 'PLL_ACCEPTANCE',
      Severity: Minor
      Found in tests/Integrations/ManageConsents.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 assigning values to variables in if clauses and the like (line '104', column '9').
      Open

          public function testGenerateToken(): void
          {
              $moduleName = 'Contacts';
              $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
              if (!($field = current($moduleModel->getFieldsByType('token', true)))) {
      Severity: Minor
      Found in tests/Integrations/ManageConsents.php by phpmd

      IfStatementAssignment

      Since: 2.7.0

      Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($foo = 'bar') { // possible typo
                  // ...
              }
              if ($baz = 0) { // always false
                  // ...
              }
          }
      }

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

      Avoid using static access to class '\Settings_WebserviceApps_Record_Model' in method 'testAddConfiguration'.
      Open

              $app = \Settings_WebserviceApps_Record_Model::getCleanInstance();
      Severity: Minor
      Found in tests/Integrations/ManageConsents.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\Vtiger_Record_Model' in method 'testGetConsents'.
      Open

              $recordModel = \Vtiger_Record_Model::getInstanceById(self::$recordId);
      Severity: Minor
      Found in tests/Integrations/ManageConsents.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\RequestHttp' in method 'setUp'.
      Open

              $this->httpClient = new \GuzzleHttp\Client(\App\Utils::merge(\App\RequestHttp::getOptions(), [
      Severity: Minor
      Found in tests/Integrations/ManageConsents.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\Utils' in method 'setUp'.
      Open

              $this->httpClient = new \GuzzleHttp\Client(\App\Utils::merge(\App\RequestHttp::getOptions(), [
                  'base_uri' => \App\Config::main('site_URL') . 'webservice/ManageConsents/',
                  'Content-Type' => 'application/json',
                  'Accept' => 'application/json',
                  'timeout' => 60,
      Severity: Minor
      Found in tests/Integrations/ManageConsents.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\Vtiger_Module_Model' in method 'testGenerateToken'.
      Open

              $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
      Severity: Minor
      Found in tests/Integrations/ManageConsents.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\App\Fields\Token' in method 'testGenerateToken'.
      Open

              \App\Fields\Token::setTokens($field->name, $moduleName);
      Severity: Minor
      Found in tests/Integrations/ManageConsents.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 '\ApprovalsRegister_Module_Model' in method 'testAddConsent'.
      Open

              \ApprovalsRegister_Module_Model::reloadApprovals(self::$recordId);
      Severity: Minor
      Found in tests/Integrations/ManageConsents.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 'testGenerateToken'.
      Open

              $recordModel->set('assigned_user_id', \App\User::getCurrentUserId());
      Severity: Minor
      Found in tests/Integrations/ManageConsents.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\Utils' in method 'testGetConsents'.
      Open

              $request = $this->httpClient->post('Contacts/GetConsentsForEntry', \App\Utils::merge(['json' => [
                  'token' => $recordModel->get('token'),
              ]], self::$requestOptions));
      Severity: Minor
      Found in tests/Integrations/ManageConsents.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 'setUpBeforeClass'.
      Open

              $recordModel->set('assigned_user_id', \App\User::getCurrentUserId());
      Severity: Minor
      Found in tests/Integrations/ManageConsents.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\Config' in method 'setUp'.
      Open

                  'base_uri' => \App\Config::main('site_URL') . 'webservice/ManageConsents/',
      Severity: Minor
      Found in tests/Integrations/ManageConsents.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\Vtiger_Record_Model' in method 'testGenerateToken'.
      Open

              $recordModel = \Vtiger_Record_Model::getInstanceById(self::$recordId);
      Severity: Minor
      Found in tests/Integrations/ManageConsents.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 'testAddConfiguration'.
      Open

              $user->set('user_id', \App\User::getActiveAdminId());
      Severity: Minor
      Found in tests/Integrations/ManageConsents.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\App\Json' in method 'testGetConsents'.
      Open

              $response = \App\Json::decode($body);
      Severity: Minor
      Found in tests/Integrations/ManageConsents.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 "headers" 3 times.
      Open

                  'headers' => [
      Severity: Critical
      Found in tests/Integrations/ManageConsents.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 "token" 10 times.
      Open

              if (!($field = current($moduleModel->getFieldsByType('token', true)))) {
      Severity: Critical
      Found in tests/Integrations/ManageConsents.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 "result" 6 times.
      Open

              static::assertNotEmpty($response['result'], 'Approvals/RecordsList result is empty and should have at least one entry: ' . self::$approvalId);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.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 "ManageConsents" 3 times.
      Open

              $app->set('type', 'ManageConsents');
      Severity: Critical
      Found in tests/Integrations/ManageConsents.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 "status" 6 times.
      Open

              $app->set('status', 1);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.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 method get from undeclared class \GuzzleHttp\Client
      Open

              $request = $this->httpClient->get('Approvals/RecordsList', self::$requestOptions);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Call to method reloadApprovals from undeclared class \ApprovalsRegister_Module_Model
      Open

              \ApprovalsRegister_Module_Model::reloadApprovals(self::$recordId);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertSame
      Open

              static::assertSame($approvalField->getUITypeModel()->getArrayValues($recordModel->get($approvalField->getName())), $response['result']['consents'], 'Contacts/GetConsentsForEntry record should be the same: (array) ' . self::$approvalId);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Call to method __construct from undeclared class \FR3D\SwaggerAssertions\SchemaManager
      Open

              self::$schemaManager = new SchemaManager(json_decode(file_get_contents(ROOT_DIRECTORY . \App\Installer\Developer::PATH . '/ManageConsents.json')));
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Assigning int to property but \Tests\Integrations\ManageConsents::$recordId is array
      Open

              self::$recordId = $recordModel->getId();
      Severity: Minor
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertSame
      Open

              static::assertSame(1, $response['status'], 'ApprovalsRegister/Record API error: ' . PHP_EOL . $request->getReasonPhrase() . '|' . $body);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertSame
      Open

              static::assertSame(1, $response['status'], 'Contacts/GetConsentsForEntry API error: ' . PHP_EOL . $request->getReasonPhrase() . '|' . $body);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Assigning 64 to property but \vtlib\Field->maximumlength is string
      Open

                  $field->maximumlength = \Vtiger_Token_UIType::MAX_LENGTH;
      Severity: Minor
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertSame
      Open

              static::assertSame($row['status'], 1);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertResponseBodyMatch
      Open

              self::assertResponseBodyMatch($response, self::$schemaManager, '/webservice/ManageConsents/Approvals/RecordsList', 'get', 200);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertSame
      Open

              static::assertSame(self::$recordId, $response['result']['id'], 'Contacts/GetConsentsForEntry record should be the same: ' . self::$recordId);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Assigning 'varchar\x2864\x29' to property but \vtlib\Field->columntype is false
      Open

                  $field->columntype = 'varchar(' . \Vtiger_Token_UIType::MAX_LENGTH . ')';
      Severity: Minor
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertNotFalse
      Open

              static::assertNotFalse($row, 'No record id: ' . self::$apiUserId);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertNotEmpty
      Open

              static::assertNotEmpty($response['result']['id'], 'ApprovalsRegister/Record record should not be empty');
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Call to undeclared method \Vtiger_Base_UIType::getArrayValues
      Open

              static::assertSame($approvalField->getUITypeModel()->getArrayValues($recordModel->get($approvalField->getName())), $response['result']['consents'], 'Contacts/GetConsentsForEntry record should be the same: (array) ' . self::$approvalId);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

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

              $row = (new \App\Db\Query())->from($user->baseTable)->where(['id' => self::$apiUserId])->one();
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertSame
      Open

              static::assertSame(1, $response['status'], 'Approvals/RecordsList API error: ' . PHP_EOL . $request->getReasonPhrase() . '|' . $body);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Property \Tests\Integrations\ManageConsents::$schemaManager has undeclared type \FR3D\SwaggerAssertions\SchemaManager
      Open

          protected static $schemaManager;
      Severity: Minor
      Found in tests/Integrations/ManageConsents.php by phan

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

              $user->set('user_id', \App\User::getActiveAdminId());
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertResponseBodyMatch
      Open

              self::assertResponseBodyMatch($response, self::$schemaManager, '/webservice/ManageConsents/ApprovalsRegister/Record', 'post', 200);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      array to string conversion
      Open

              static::assertSame(self::$recordId, $response['result']['id'], 'Contacts/GetConsentsForEntry record should be the same: ' . self::$recordId);

      Call to method post from undeclared class \GuzzleHttp\Client
      Open

              $request = $this->httpClient->post('ApprovalsRegister/Record', \App\Utils::merge(['json' => [
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Argument 1 (recordId) is array but \Vtiger_Record_Model::getInstanceById() takes int defined at /code/modules/Vtiger/models/Record.php:763
      Open

              $recordModel = \Vtiger_Record_Model::getInstanceById(self::$recordId);
      Severity: Minor
      Found in tests/Integrations/ManageConsents.php by phan

      Call to method __construct from undeclared class \GuzzleHttp\Client
      Open

              $this->httpClient = new \GuzzleHttp\Client(\App\Utils::merge(\App\RequestHttp::getOptions(), [
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertNotEmpty
      Open

              static::assertNotEmpty($recordModel->get('token'), 'Token should not be empty for field: ' . $field->name);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertNotFalse
      Open

              static::assertNotFalse($row, 'No record id: ' . self::$serverId);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertSame
      Open

              static::assertSame(200, $request->getStatusCode(), 'Approvals/RecordsList API error: ' . PHP_EOL . $request->getReasonPhrase() . '|' . $body);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertNotEmpty
      Open

              static::assertNotEmpty($response['result'], 'Approvals/RecordsList result is empty and should have at least one entry: ' . self::$approvalId);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertNotEmpty
      Open

              static::assertNotEmpty($response['result'], 'ApprovalsRegister/Record result is empty and should have at least one entry.');
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertSame
      Open

              static::assertSame($row['name'], $app->get('name'));
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertNotEmpty
      Open

              static::assertNotEmpty($response['result']['records'][self::$approvalId], 'Approvals/RecordsList record:' . self::$approvalId . ' not exists');
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Class uses undeclared trait \FR3D\SwaggerAssertions\PhpUnit\AssertsTrait
      Open

      final class ManageConsents extends \Tests\Base
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertSame
      Open

              static::assertSame($row['type'], 'ManageConsents');
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertSame
      Open

              static::assertSame((int) $row['server_id'], self::$serverId);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertSame
      Open

              static::assertSame($row['token'], $user->get('token'));
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertSame
      Open

              static::assertSame(200, $request->getStatusCode(), 'Contacts/GetConsentsForEntry error: ' . PHP_EOL . $request->getReasonPhrase() . '|' . $body);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

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

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

      Argument 1 (recordId) is array but \Vtiger_Record_Model::getInstanceById() takes int defined at /code/modules/Vtiger/models/Record.php:763
      Open

              $recordModel = \Vtiger_Record_Model::getInstanceById(self::$recordId);
      Severity: Minor
      Found in tests/Integrations/ManageConsents.php by phan

      Assigning 'token' to property but \vtlib\Field->column is false
      Open

                  $field->column = 'token';
      Severity: Minor
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertSame
      Open

              static::assertSame($row['pass'], $app->get('pass'));
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertSame
      Open

              static::assertSame(200, $request->getStatusCode(), 'ApprovalsRegister/RecordAPI error: ' . PHP_EOL . $request->getReasonPhrase() . '|' . $body);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Property \Tests\Integrations\ManageConsents->httpClient has undeclared type \GuzzleHttp\Client
      Open

          protected $httpClient;
      Severity: Minor
      Found in tests/Integrations/ManageConsents.php by phan

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

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

      Call to method post from undeclared class \GuzzleHttp\Client
      Open

              $request = $this->httpClient->post('Contacts/GetConsentsForEntry', \App\Utils::merge(['json' => [
      Severity: Critical
      Found in tests/Integrations/ManageConsents.php by phan

      Static call to undeclared method \Tests\Integrations\ManageConsents::assertResponseBodyMatch
      Open

              self::assertResponseBodyMatch($response, self::$schemaManager, '/webservice/ManageConsents/Contacts/GetConsentsForEntry', 'post', 200);
      Severity: Critical
      Found in tests/Integrations/ManageConsents.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

           */

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

           *

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

           * @var int

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

          private static $requestOptions = [];

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

          private static $approvalId;

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

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

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

              $recordModel->set('approvals_status', 'PLL_ACTIVE');

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

              self::$requestOptions['headers']['x-api-key'] = $row['api_key'];

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

              static::assertSame($row['token'], $user->get('token'));

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

           * Testing RecordsList.

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

              $request = $this->httpClient->get('Approvals/RecordsList', self::$requestOptions);

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

              $response = \App\Json::decode($body);

      Line exceeds 120 characters; contains 152 characters
      Open

              static::assertSame(200, $request->getStatusCode(), 'ApprovalsRegister/RecordAPI error: ' . PHP_EOL . $request->getReasonPhrase() . '|' . $body);

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

              static::assertSame(1, $response['status'], 'ApprovalsRegister/Record API error: ' . PHP_EOL . $request->getReasonPhrase() . '|' . $body);

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

                  'token' => $recordModel->get('token'),

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

              self::assertResponseBodyMatch($response, self::$schemaManager, '/webservice/ManageConsents/Contacts/GetConsentsForEntry', 'post', 200);

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

           */

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

          {

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

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

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

              $user->set('type', \Api\WebservicePremium\Privilege::USER_PERMISSIONS);

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

           * Gets the list of consents for specific entry.

      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

           * @var array

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

           * @var array

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

              self::$schemaManager = new SchemaManager(json_decode(file_get_contents(ROOT_DIRECTORY . \App\Installer\Developer::PATH . '/ManageConsents.json')));

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

              self::$approvalId = $recordModel->getId();

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

                  $field->column = 'token';

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

           * Testing add configuration.

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

              static::assertSame($row['type'], 'ManageConsents');

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

           */

      Line exceeds 120 characters; contains 132 characters
      Open

              static::assertNotEmpty($response['result'], 'ApprovalsRegister/Record result is empty and should have at least one entry.');

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

              self::assertResponseBodyMatch($response, self::$schemaManager, '/webservice/ManageConsents/ApprovalsRegister/Record', 'post', 200);

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

          }

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

              static::assertSame($approvalField->getUITypeModel()->getArrayValues($recordModel->get($approvalField->getName())), $response['result']['consents'], 'Contacts/GetConsentsForEntry record should be the same: (array) ' . self::$approvalId);

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

           * Api server id.

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

           *

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

           * @var SchemaManager

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

                  'connect_timeout' => 60,

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

                  $blockInstance = current($moduleModel->getBlocks());

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

                  $field->columntype = 'varchar(' . \Vtiger_Token_UIType::MAX_LENGTH . ')';

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

                  $field->uitype = 324;

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

          /**

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

              $app->set('url', '');

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

              $app->save();

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

              $user->set('user_id', \App\User::getActiveAdminId());

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

          {

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

              static::assertNotEmpty($response['result'], 'ApprovalsRegister/Record result is empty and should have at least one entry.');

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

              \ApprovalsRegister_Module_Model::reloadApprovals(self::$recordId);

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

           */

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

           * Api user id.

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

              $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);

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

                  $field->displaytype = 3;

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

              $recordModel->set('salutationtype', 'Mr.');

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

              self::$requestOptions['headers']['x-token'] = $user->get('token');

      Line exceeds 120 characters; contains 150 characters
      Open

              static::assertNotEmpty($response['result'], 'Approvals/RecordsList result is empty and should have at least one entry: ' . self::$approvalId);

      Line exceeds 120 characters; contains 151 characters
      Open

              static::assertNotEmpty($response['result']['records'][self::$approvalId], 'Approvals/RecordsList record:' . self::$approvalId . ' not exists');

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

              self::assertResponseBodyMatch($response, self::$schemaManager, '/webservice/ManageConsents/Approvals/RecordsList', 'get', 200);

      Line exceeds 120 characters; contains 139 characters
      Open

              self::assertResponseBodyMatch($response, self::$schemaManager, '/webservice/ManageConsents/ApprovalsRegister/Record', 'post', 200);

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

           *

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

                  'timeout' => 60,

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

              ]));

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

          public function testGenerateToken(): void

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

              $moduleName = 'Contacts';

      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

              $request = $this->httpClient->post('ApprovalsRegister/Record', \App\Utils::merge(['json' => [

      Line exceeds 120 characters; contains 145 characters
      Open

              static::assertSame(1, $response['status'], 'ApprovalsRegister/Record API error: ' . PHP_EOL . $request->getReasonPhrase() . '|' . $body);

      Line exceeds 120 characters; contains 244 characters
      Open

              static::assertSame($approvalField->getUITypeModel()->getArrayValues($recordModel->get($approvalField->getName())), $response['result']['consents'], 'Contacts/GetConsentsForEntry record should be the same: (array) ' . self::$approvalId);

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

          /**

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

          private static $apiUserId;

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

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

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

          }

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

                  'Accept' => 'application/json',

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

           */

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

                  $field->table = $moduleModel->tableName;

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

              static::assertNotEmpty($recordModel->get('token'), 'Token should not be empty for field: ' . $field->name);

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

              static::assertSame($row['name'], $app->get('name'));

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

              self::$requestOptions['auth'] = [$app->get('name'), $app->get('pass')];

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

              static::assertSame(1, $response['status'], 'Approvals/RecordsList API error: ' . PHP_EOL . $request->getReasonPhrase() . '|' . $body);

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

          public function testAddConsent(): void

      Line exceeds 120 characters; contains 153 characters
      Open

              static::assertSame(200, $request->getStatusCode(), 'Contacts/GetConsentsForEntry error: ' . PHP_EOL . $request->getReasonPhrase() . '|' . $body);

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

              static::assertSame(1, $response['status'], 'Contacts/GetConsentsForEntry API error: ' . PHP_EOL . $request->getReasonPhrase() . '|' . $body);

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

          /**

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

          /**

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

          protected $httpClient;

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

          /**

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

          {

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

              $recordModel->set('email', 'manage_consents@yetiforce.com');

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

              $row = \App\Fields\ServerAccess::get(self::$serverId);

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

              static::assertSame($row['pass'], $app->get('pass'));

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

              self::$apiUserId = $user->getId();

      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->logs = $body = $request->getBody()->getContents();

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

                  'contactid' => self::$recordId,

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

              $response = \App\Json::decode($body);

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

              static::assertSame(self::$recordId, $response['result']['id'], 'Contacts/GetConsentsForEntry record should be the same: ' . self::$recordId);

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

          use AssertsTrait;

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

           * @var int

      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->httpClient = new \GuzzleHttp\Client(\App\Utils::merge(\App\RequestHttp::getOptions(), [

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

                  'base_uri' => \App\Config::main('site_URL') . 'webservice/ManageConsents/',

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

                  $field->name = 'token';

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

                  $field->maximumlength = \Vtiger_Token_UIType::MAX_LENGTH;

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

                  $field->typeofdata = 'V~O';

      Line exceeds 120 characters; contains 135 characters
      Open

              self::assertResponseBodyMatch($response, self::$schemaManager, '/webservice/ManageConsents/Approvals/RecordsList', 'get', 200);

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

              $response = \App\Json::decode($body);

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

          public function testGetConsents(): void

      Line exceeds 120 characters; contains 143 characters
      Open

              self::assertResponseBodyMatch($response, self::$schemaManager, '/webservice/ManageConsents/Contacts/GetConsentsForEntry', 'post', 200);

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

           * Request options.

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

           */

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

          /**

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

          protected static $schemaManager;

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

           * @return void

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

                  ],

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

           * Testing generate token.

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

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

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

          {

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

              static::assertNotEmpty($response['result'], 'Approvals/RecordsList result is empty and should have at least one entry: ' . self::$approvalId);

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

                  'registration_date' => date('Y-m-d H:i:s'),

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

          /**

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

           * Before a test method is run, this method is invoked.

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

          }

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

                  $field = new \vtlib\Field();

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

              \App\Fields\Token::setTokens($field->name, $moduleName);

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

          }

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

              $app = \Settings_WebserviceApps_Record_Model::getCleanInstance();

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

              $app->set('name', 'manage_consents');

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

              $app->set('ips', '');

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

              static::assertSame($row['status'], 1);

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

              static::assertSame((int) $row['server_id'], self::$serverId);

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

              static::assertNotEmpty($response['result']['records'][self::$approvalId], 'Approvals/RecordsList record:' . self::$approvalId . ' not exists');

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

                  'approvals_register_type' => 'PLL_ACCEPTANCE',

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

                  'approvals_register_status' => 'PLL_ACCEPTED',

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

              $this->logs = $body = $request->getBody()->getContents();

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

           *

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

          private static $serverId;

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

          private static $recordId;

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

           */

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

                  'Content-Type' => 'application/json',

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

              if (!($field = current($moduleModel->getFieldsByType('token', true)))) {

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

                  $blockInstance->addField($field);

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

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

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

              $recordModel->set('lastname', 'Testowy');

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

              $recordModel->set('contactstatus', 'Active');

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

              $recordModel->save();

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

              $recordModel = \Vtiger_Record_Model::getInstanceById(self::$recordId);

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

           */

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

              $user->save();

      Line exceeds 120 characters; contains 142 characters
      Open

              static::assertSame(1, $response['status'], 'Approvals/RecordsList API error: ' . PHP_EOL . $request->getReasonPhrase() . '|' . $body);

      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

                  'approvalsid' => self::$approvalId,

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

              $recordModel = \Vtiger_Record_Model::getInstanceById(self::$recordId);

      Line exceeds 120 characters; contains 149 characters
      Open

              static::assertSame(1, $response['status'], 'Contacts/GetConsentsForEntry API error: ' . PHP_EOL . $request->getReasonPhrase() . '|' . $body);

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

           * Record ID.

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

          public static function setUpBeforeClass(): void

      Line exceeds 120 characters; contains 155 characters
      Open

              self::$schemaManager = new SchemaManager(json_decode(file_get_contents(ROOT_DIRECTORY . \App\Installer\Developer::PATH . '/ManageConsents.json')));

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

                  'headers' => [

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

                      'x-raw-data' => 1,

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

                  $field->label = 'token';

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

                  $field->defaultvalue = '';

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

              self::$recordId = $recordModel->getId();

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

              $user = \Settings_WebserviceUsers_Record_Model::getCleanInstance('ManageConsents');

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

              $user->set('server_id', self::$serverId);

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

              static::assertSame(200, $request->getStatusCode(), 'Approvals/RecordsList API error: ' . PHP_EOL . $request->getReasonPhrase() . '|' . $body);

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

          }

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

           */

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

           */

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

           * @var \GuzzleHttp\Client

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

           *

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

                  'http_errors' => false,

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

          public function testAddConfiguration(): void

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

          {

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

              $app->set('pass', 'manage_consents');

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

              self::$serverId = (int) $app->getId();

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

              $user->set('status', 1);

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

              $row = (new \App\Db\Query())->from($user->baseTable)->where(['id' => self::$apiUserId])->one();

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

              static::assertNotFalse($row, 'No record id: ' . self::$apiUserId);

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

           * Adds an consent entry.

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

                  'subject' => 'Text',

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

              $request = $this->httpClient->post('Contacts/GetConsentsForEntry', \App\Utils::merge(['json' => [

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

              $this->logs = $body = $request->getBody()->getContents();

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

          protected function setUp(): void

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

              $app->set('type', 'ManageConsents');

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

              static::assertNotFalse($row, 'No record id: ' . self::$serverId);

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

           * @return void

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

          {

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

              $approvalField = current($recordModel->getModule()->getFieldsByType('multiReference', true));

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

              ]], self::$requestOptions));

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

              static::assertSame(200, $request->getStatusCode(), 'Contacts/GetConsentsForEntry error: ' . PHP_EOL . $request->getReasonPhrase() . '|' . $body);

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

           *

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

          {

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

              $recordModel->set('name', 'Consent1');

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

              $recordModel->save();

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

              }

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

              $app->set('status', 1);

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

          public function testRecordsList(): void

      Line exceeds 120 characters; contains 150 characters
      Open

              static::assertSame(200, $request->getStatusCode(), 'Approvals/RecordsList API error: ' . PHP_EOL . $request->getReasonPhrase() . '|' . $body);

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

           */

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

              ]], self::$requestOptions));

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

              static::assertSame(200, $request->getStatusCode(), 'ApprovalsRegister/RecordAPI error: ' . PHP_EOL . $request->getReasonPhrase() . '|' . $body);

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

              static::assertNotEmpty($response['result']['id'], 'ApprovalsRegister/Record record should not be empty');

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

           * @return void

      Line exceeds 120 characters; contains 149 characters
      Open

              static::assertSame(self::$recordId, $response['result']['id'], 'Contacts/GetConsentsForEntry record should be the same: ' . self::$recordId);

      There are no issues that match your filters.

      Category
      Status