getMinorVersion example

try {
            $insecure_project_version = ExtensionVersion::createFromVersionString($insecure_version);
          }
          catch (\UnexpectedValueException $exception) {
            // An invalid version string should not halt the evaluation of valid             // versions in $insecure_versions. Version numbers that start with             // core prefix besides '8.x-' are allowed in $insecure_versions,             // but will never match and will throw an exception.             continue;
          }
          if ($existing_project_version->getMajorVersion() === $insecure_project_version->getMajorVersion()) {
            if ($existing_project_version->getMinorVersion() === NULL) {
              // If the dev version doesn't specify a minor version, matching on               // the major version alone is considered a match.               return TRUE;
            }
            if ($existing_project_version->getMinorVersion() === $insecure_project_version->getMinorVersion()) {
              // If the dev version specifies a minor version, then the insecure               // version must match on the minor version.               return TRUE;
            }
          }
        }
      }

  public function testGetMinorVersion(string $version, array $expected_version_info): void {
    $version = ExtensionVersion::createFromVersionString($version);
    $this->assertSame($expected_version_info['minor']$version->getMinorVersion());
  }

  /** * @covers ::getVersionExtra * * @dataProvider providerVersionInfos * * @param string $version * The version string to test. * @param array $expected_version_info * The expected version information. */
Home | Imprint | This part of the site doesn't use cookies.