diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-06-15 17:20:38 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-07-17 12:34:56 +0200 |
commit | f228a3dc28b579b3d11126544928edacd2e2d9c4 (patch) | |
tree | d11eebce3ef51c264bc896cf28cb14a132559d8f /tests/data | |
parent | 483c886291f23577417d820a8e65702ec0d1cc85 (diff) | |
download | nextcloud-server-f228a3dc28b579b3d11126544928edacd2e2d9c4.tar.gz nextcloud-server-f228a3dc28b579b3d11126544928edacd2e2d9c4.zip |
Add support for deprecated constants
Diffstat (limited to 'tests/data')
4 files changed, 46 insertions, 0 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 new file mode 100644 index 00000000000..4f3d3e81316 --- /dev/null +++ b/tests/data/app/code-checker/test-deprecated-constant-alias.php @@ -0,0 +1,12 @@ +<?php + +use OCP\NamespaceName\ClassName as Constant; + +/** + * Class BadClass - creating an instance of a blacklisted class is not allowed + */ +class BadClass { + public function test() { + return Constant::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 new file mode 100644 index 00000000000..b7e7c7e6be9 --- /dev/null +++ b/tests/data/app/code-checker/test-deprecated-constant-sub-alias.php @@ -0,0 +1,12 @@ +<?php + +use OCP\NamespaceName as Constant; + +/** + * Class BadClass - creating an instance of a blacklisted class is not allowed + */ +class BadClass { + public function test() { + return Constant\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 new file mode 100644 index 00000000000..0ef837c14c6 --- /dev/null +++ b/tests/data/app/code-checker/test-deprecated-constant-sub.php @@ -0,0 +1,12 @@ +<?php + +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; + } +} diff --git a/tests/data/app/code-checker/test-deprecated-constant.php b/tests/data/app/code-checker/test-deprecated-constant.php new file mode 100644 index 00000000000..965d84500fd --- /dev/null +++ b/tests/data/app/code-checker/test-deprecated-constant.php @@ -0,0 +1,10 @@ +<?php + +/** + * Class BadClass - creating an instance of a blacklisted class is not allowed + */ +class BadClass { + public function test() { + return \OCP\NamespaceName\ClassName::CONSTANT_NAME; + } +} |