diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-06-15 17:50:37 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-07-17 12:34:56 +0200 |
commit | 2783a780708e4e5c04b6935840416d219bc4d852 (patch) | |
tree | 1e2ff2fa51e2e9eeb8ae72bcf68718ba720cac07 /tests/data | |
parent | f228a3dc28b579b3d11126544928edacd2e2d9c4 (diff) | |
download | nextcloud-server-2783a780708e4e5c04b6935840416d219bc4d852.tar.gz nextcloud-server-2783a780708e4e5c04b6935840416d219bc4d852.zip |
Allow checking for functions
Diffstat (limited to 'tests/data')
8 files changed, 24 insertions, 22 deletions
diff --git a/tests/data/app/code-checker/test-deprecated-constant-alias.php b/tests/data/app/code-checker/test-deprecated-constant-alias.php index 4f3d3e81316..b5a5bfdb762 100644 --- a/tests/data/app/code-checker/test-deprecated-constant-alias.php +++ b/tests/data/app/code-checker/test-deprecated-constant-alias.php @@ -1,12 +1,8 @@ <?php -use OCP\NamespaceName\ClassName as Constant; +use OCP\NamespaceName\ClassName as Alias; /** * Class BadClass - creating an instance of a blacklisted class is not allowed */ -class BadClass { - public function test() { - return Constant::CONSTANT_NAME; - } -} +Alias::CONSTANT_NAME; diff --git a/tests/data/app/code-checker/test-deprecated-constant-sub-alias.php b/tests/data/app/code-checker/test-deprecated-constant-sub-alias.php index b7e7c7e6be9..9b1757aa683 100644 --- a/tests/data/app/code-checker/test-deprecated-constant-sub-alias.php +++ b/tests/data/app/code-checker/test-deprecated-constant-sub-alias.php @@ -1,12 +1,8 @@ <?php -use OCP\NamespaceName as Constant; +use OCP\NamespaceName as SubAlias; /** * Class BadClass - creating an instance of a blacklisted class is not allowed */ -class BadClass { - public function test() { - return Constant\ClassName::CONSTANT_NAME; - } -} +SubAlias\ClassName::CONSTANT_NAME; diff --git a/tests/data/app/code-checker/test-deprecated-constant-sub.php b/tests/data/app/code-checker/test-deprecated-constant-sub.php index 0ef837c14c6..86e0ff52efe 100644 --- a/tests/data/app/code-checker/test-deprecated-constant-sub.php +++ b/tests/data/app/code-checker/test-deprecated-constant-sub.php @@ -5,8 +5,4 @@ use OCP\NamespaceName; /** * Class BadClass - creating an instance of a blacklisted class is not allowed */ -class BadClass { - public function test() { - return NamespaceName\ClassName::CONSTANT_NAME; - } -} +NamespaceName\ClassName::CONSTANT_NAME; diff --git a/tests/data/app/code-checker/test-deprecated-constant.php b/tests/data/app/code-checker/test-deprecated-constant.php index 965d84500fd..170b1d9e5ad 100644 --- a/tests/data/app/code-checker/test-deprecated-constant.php +++ b/tests/data/app/code-checker/test-deprecated-constant.php @@ -3,8 +3,4 @@ /** * Class BadClass - creating an instance of a blacklisted class is not allowed */ -class BadClass { - public function test() { - return \OCP\NamespaceName\ClassName::CONSTANT_NAME; - } -} +\OCP\NamespaceName\ClassName::CONSTANT_NAME; diff --git a/tests/data/app/code-checker/test-deprecated-function-alias.php b/tests/data/app/code-checker/test-deprecated-function-alias.php new file mode 100644 index 00000000000..0c958cc635c --- /dev/null +++ b/tests/data/app/code-checker/test-deprecated-function-alias.php @@ -0,0 +1,5 @@ +<?php + +use OCP\NamespaceName\ClassName as Alias; + +Alias::functionName(); diff --git a/tests/data/app/code-checker/test-deprecated-function-sub-alias.php b/tests/data/app/code-checker/test-deprecated-function-sub-alias.php new file mode 100644 index 00000000000..f728eaf9fd0 --- /dev/null +++ b/tests/data/app/code-checker/test-deprecated-function-sub-alias.php @@ -0,0 +1,5 @@ +<?php + +use OCP\NamespaceName as SubAlias; + +SubAlias\ClassName::functionName(); diff --git a/tests/data/app/code-checker/test-deprecated-function-sub.php b/tests/data/app/code-checker/test-deprecated-function-sub.php new file mode 100644 index 00000000000..f7e15903d5d --- /dev/null +++ b/tests/data/app/code-checker/test-deprecated-function-sub.php @@ -0,0 +1,5 @@ +<?php + +use OCP\NamespaceName; + +NamespaceName\ClassName::functionName(); diff --git a/tests/data/app/code-checker/test-deprecated-function.php b/tests/data/app/code-checker/test-deprecated-function.php new file mode 100644 index 00000000000..0016076e377 --- /dev/null +++ b/tests/data/app/code-checker/test-deprecated-function.php @@ -0,0 +1,3 @@ +<?php + +\OCP\NamespaceName\ClassName::functionName(); |