diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-09-06 14:16:37 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-09-06 14:16:37 +0400 |
commit | eee6ed99cf522e4e65df6618f5cd919a18da481b (patch) | |
tree | 5e7b017e408a9f9597868227919182db1f8c66f5 /tests/PHPUnit/Core | |
parent | 099c969cb987607437c6b7beabcd4e6883e5998d (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.php | 20 |
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 |