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:
authorThomas Steur <tsteur@users.noreply.github.com>2016-04-18 23:26:28 +0300
committerThomas Steur <tsteur@users.noreply.github.com>2016-04-18 23:26:28 +0300
commit252148a742fa0681066d16a2aba30d429ef45e25 (patch)
tree2b424cd96d2ac9e7144a345cdd238ea456391836 /tests/PHPUnit/Unit/DeprecatedMethodsTest.php
parent223e8cc9660f8ef19e18e3b903407a16727d89b9 (diff)
Improved plugins update API (#10028)
* refs #7983 let plugins add or remove fields to websites and better settings api * * Hide CorePluginsAdmin API methods * More documentation * Added some more tests * improved updates API for plugins * better error code as duplicate column cannot really happen when not actually renaming a colum
Diffstat (limited to 'tests/PHPUnit/Unit/DeprecatedMethodsTest.php')
-rw-r--r--tests/PHPUnit/Unit/DeprecatedMethodsTest.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/PHPUnit/Unit/DeprecatedMethodsTest.php b/tests/PHPUnit/Unit/DeprecatedMethodsTest.php
index ff2dd4bcbd..59c7ca86ae 100644
--- a/tests/PHPUnit/Unit/DeprecatedMethodsTest.php
+++ b/tests/PHPUnit/Unit/DeprecatedMethodsTest.php
@@ -80,6 +80,11 @@ class DeprecatedMethodsTest extends \PHPUnit_Framework_TestCase
$this->assertDeprecatedMethodIsRemovedInPiwik3('Piwik\Plugins\Resolution\Resolution', 'renameUserSettingsModuleAndAction');
$this->assertDeprecatedMethodIsRemovedInPiwik3('Piwik\Plugins\DevicePlugins\DevicePlugins', 'renameUserSettingsModuleAndAction');
$this->assertDeprecatedMethodIsRemovedInPiwik3('Piwik\Plugins\UserLanguage\UserLanguage', 'renameUserSettingsModuleAndAction');
+
+ $this->assertDeprecatedMethodIsRemovedInPiwik4('Piwik\Updates', 'getSql');
+ $this->assertDeprecatedMethodIsRemovedInPiwik4('Piwik\Updates', 'update');
+ $this->assertDeprecatedMethodIsRemovedInPiwik4('Piwik\Updates', 'getMigrationQueries');
+ $this->assertDeprecatedMethodIsRemovedInPiwik4('Piwik\Updater', 'executeMigrationQueries');
}
private function assertDeprecatedMethodIsRemoved($className, $method, $removalDate)
@@ -126,14 +131,24 @@ class DeprecatedMethodsTest extends \PHPUnit_Framework_TestCase
private function assertDeprecatedMethodIsRemovedInPiwik3($className, $method)
{
+ $this->assertDeprecatedMethodIsRemovedInPiwikVersion('3.0.0', $className, $method);
+ }
+
+ private function assertDeprecatedMethodIsRemovedInPiwik4($className, $method)
+ {
+ $this->assertDeprecatedMethodIsRemovedInPiwikVersion('4.0.0', $className, $method);
+ }
+
+ private function assertDeprecatedMethodIsRemovedInPiwikVersion($piwikVersion, $className, $method)
+ {
$version = Version::VERSION;
$class = new ReflectionClass($className);
$methodExists = $class->hasMethod($method);
- if (-1 === version_compare($version, '3.0.0')) {
+ if (-1 === version_compare($version, $piwikVersion)) {
- $errorMessage = $className . '::' . $method . ' should still exists until 3.0 although it is deprecated.';
+ $errorMessage = $className . '::' . $method . ' should still exists until ' . $piwikVersion . ' although it is deprecated.';
$this->assertTrue($methodExists, $errorMessage);
return;
}