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 <thomas.steur@googlemail.com>2014-09-06 14:16:37 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-09-06 14:16:37 +0400
commiteee6ed99cf522e4e65df6618f5cd919a18da481b (patch)
tree5e7b017e408a9f9597868227919182db1f8c66f5 /tests/PHPUnit/Core
parent099c969cb987607437c6b7beabcd4e6883e5998d (diff)
refs #6140 easier way to define URLs for menu items and introducing a method to addItem without boolean parameter
Diffstat (limited to 'tests/PHPUnit/Core')
-rw-r--r--tests/PHPUnit/Core/DeprecatedMethodsTest.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/PHPUnit/Core/DeprecatedMethodsTest.php b/tests/PHPUnit/Core/DeprecatedMethodsTest.php
index ce496684ba..47bbddb2d2 100644
--- a/tests/PHPUnit/Core/DeprecatedMethodsTest.php
+++ b/tests/PHPUnit/Core/DeprecatedMethodsTest.php
@@ -29,6 +29,8 @@ class DeprecatedMethodsTest extends PHPUnit_Framework_TestCase
$validTill = '2014-10-15';
$this->assertDeprecatedMethodIsRemoved('\Piwik\SettingsPiwik', 'rewriteTmpPathWithHostname', $validTill);
+
+ $this->assertDeprecatedMethodIsRemovedInPiwik3('\Piwik\Menu\MenuAbstract', 'add');
}
private function assertDeprecatedMethodIsRemoved($className, $method, $removalDate)
@@ -49,4 +51,22 @@ class DeprecatedMethodsTest extends PHPUnit_Framework_TestCase
$errorMessage = $className . '::' . $method . ' should be removed as the method is deprecated but it is not.';
$this->assertFalse($methodExists, $errorMessage);
}
+
+ private function assertDeprecatedMethodIsRemovedInPiwik3($className, $method)
+ {
+ $version = \Piwik\Version::VERSION;
+
+ $class = new ReflectionClass($className);
+ $methodExists = $class->hasMethod($method);
+
+ if (-1 === version_compare($version, '3.0.0')) {
+
+ $errorMessage = $className . '::' . $method . ' should still exists until 3.0 although it is deprecated.';
+ $this->assertTrue($methodExists, $errorMessage);
+ return;
+ }
+
+ $errorMessage = $className . '::' . $method . ' should be removed as the method is deprecated but it is not.';
+ $this->assertFalse($methodExists, $errorMessage);
+ }
} \ No newline at end of file