Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsgiehl <stefan@matomo.org>2022-09-09 16:51:13 +0300
committersgiehl <stefan@matomo.org>2022-09-09 16:51:13 +0300
commit5a59a35b8721473aababdea5881ff6915e4bb522 (patch)
tree4d1a98dd48150fd5299d297fb5eb322da2175c64
parent111cd8cb4acee6b1d6ac733f5fc1ff37e1b69335 (diff)
update changelogautosanitize
-rw-r--r--CHANGELOG.md2
-rw-r--r--tests/PHPUnit/Unit/DeprecatedMethodsTest.php29
2 files changed, 18 insertions, 13 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a74eab2f4d..4c5528da8f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -34,7 +34,7 @@ The Product Changelog at **[matomo.org/changelog](https://matomo.org/changelog)*
### Deprecations
-* The method `Common::getRequestVar` is now deprecated. Please use the new class `Piwik\Request` instead and handle needed sanitizing / escaping yourself.
+* The method `Common::getRequestVar` is now deprecated, but will remain API until Matomo 6. You may already start using the new class `Piwik\Request` instead, but ensure to handle needed sanitizing / escaping yourself.
## Matomo 4.11.0
diff --git a/tests/PHPUnit/Unit/DeprecatedMethodsTest.php b/tests/PHPUnit/Unit/DeprecatedMethodsTest.php
index 910dbe74f1..b05a34305d 100644
--- a/tests/PHPUnit/Unit/DeprecatedMethodsTest.php
+++ b/tests/PHPUnit/Unit/DeprecatedMethodsTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* Matomo - free/libre analytics platform
*
@@ -19,7 +20,7 @@ use ReflectionClass;
*/
class DeprecatedMethodsTest extends \PHPUnit\Framework\TestCase
{
- public function test_deprecations()
+ public function testDeprecations()
{
$this->assertDeprecatedMethodIsRemovedInPiwik3b1('Piwik\SettingsServer', 'isApache');
@@ -74,17 +75,19 @@ class DeprecatedMethodsTest extends \PHPUnit\Framework\TestCase
$this->assertDeprecatedMethodIsRemovedInPiwik3('Piwik\Plugins\DevicePlugins\DevicePlugins', 'renameUserSettingsModuleAndAction');
$this->assertDeprecatedMethodIsRemovedInPiwik3('Piwik\Plugins\UserLanguage\UserLanguage', 'renameUserSettingsModuleAndAction');
- $this->assertDeprecatedMethodIsRemovedInPiwik4('\Piwik\Plugin', 'getListHooksRegistered');
- $this->assertDeprecatedMethodIsRemovedInPiwik4('Piwik\Updates', 'getSql');
- $this->assertDeprecatedMethodIsRemovedInPiwik4('Piwik\Updates', 'update');
- $this->assertDeprecatedMethodIsRemovedInPiwik4('Piwik\Updates', 'getMigrationQueries');
- $this->assertDeprecatedMethodIsRemovedInPiwik4('Piwik\Updater', 'executeMigrationQueries');
+ $this->assertDeprecatedMethodIsRemovedInMatomo4('\Piwik\Plugin', 'getListHooksRegistered');
+ $this->assertDeprecatedMethodIsRemovedInMatomo4('Piwik\Updates', 'getSql');
+ $this->assertDeprecatedMethodIsRemovedInMatomo4('Piwik\Updates', 'update');
+ $this->assertDeprecatedMethodIsRemovedInMatomo4('Piwik\Updates', 'getMigrationQueries');
+ $this->assertDeprecatedMethodIsRemovedInMatomo4('Piwik\Updater', 'executeMigrationQueries');
- $this->assertDeprecatedMethodIsRemovedInPiwik4('Piwik\SettingsPiwik', 'isPiwikInstalled');
- $this->assertDeprecatedMethodIsRemovedInPiwik4('Piwik\Piwik', 'doAsSuperUser');
+ $this->assertDeprecatedMethodIsRemovedInMatomo4('Piwik\SettingsPiwik', 'isPiwikInstalled');
+ $this->assertDeprecatedMethodIsRemovedInMatomo4('Piwik\Piwik', 'doAsSuperUser');
$validTill = '2021-03-01';
$this->assertDeprecatedMethodIsRemovedBeforeDate(CronArchive::class, 'checkNoDanglingInvalidations', $validTill);
+
+ $this->assertDeprecatedMethodIsRemovedInMatomo6('Piwik\Common', 'getRequestVar');
}
@@ -101,7 +104,6 @@ class DeprecatedMethodsTest extends \PHPUnit\Framework\TestCase
$methodExists = $class->hasMethod($method);
if (!$now->isLater($removalDate)) {
-
$errorMessage = $className . '::' . $method . ' should still exists until ' . $removalDate . ' although it is deprecated.';
$this->assertTrue($methodExists, $errorMessage);
return;
@@ -120,7 +122,6 @@ class DeprecatedMethodsTest extends \PHPUnit\Framework\TestCase
$classExists = class_exists($className);
if (!$now->isLater($removalDate)) {
-
$errorMessage = $className . ' should still exists until ' . $removalDate . ' although it is deprecated.';
$this->assertTrue($classExists, $errorMessage);
return;
@@ -140,11 +141,16 @@ class DeprecatedMethodsTest extends \PHPUnit\Framework\TestCase
$this->assertDeprecatedMethodIsRemovedInPiwikVersion('3.0.0-b2', $className, $method);
}
- private function assertDeprecatedMethodIsRemovedInPiwik4($className, $method)
+ private function assertDeprecatedMethodIsRemovedInMatomo4($className, $method)
{
$this->assertDeprecatedMethodIsRemovedInPiwikVersion('4.0.0-b1', $className, $method);
}
+ private function assertDeprecatedMethodIsRemovedInMatomo6($className, $method)
+ {
+ $this->assertDeprecatedMethodIsRemovedInPiwikVersion('6.0.0-b1', $className, $method);
+ }
+
private function assertDeprecatedMethodIsRemovedInPiwikVersion($piwikVersion, $className, $method)
{
$version = Version::VERSION;
@@ -153,7 +159,6 @@ class DeprecatedMethodsTest extends \PHPUnit\Framework\TestCase
$methodExists = $class->hasMethod($method);
if (-1 === version_compare($version, $piwikVersion)) {
-
$errorMessage = $className . '::' . $method . ' should still exists until ' . $piwikVersion . ' although it is deprecated.';
$this->assertTrue($methodExists, $errorMessage);
return;