diff options
Diffstat (limited to 'tests/data/app/code-checker')
5 files changed, 48 insertions, 0 deletions
diff --git a/tests/data/app/code-checker/test-deprecated-use-alias.php b/tests/data/app/code-checker/test-deprecated-use-alias.php new file mode 100644 index 00000000000..a92187fa880 --- /dev/null +++ b/tests/data/app/code-checker/test-deprecated-use-alias.php @@ -0,0 +1,9 @@ +<?php + +use OCP\AppFramework\IApi as OAFIA; + +/** + * Class BadClass - creating an instance of a blacklisted class is not allowed + */ +class BadClass implements OAFIA { +} diff --git a/tests/data/app/code-checker/test-deprecated-use-sub-alias.php b/tests/data/app/code-checker/test-deprecated-use-sub-alias.php new file mode 100644 index 00000000000..9da4b75d216 --- /dev/null +++ b/tests/data/app/code-checker/test-deprecated-use-sub-alias.php @@ -0,0 +1,9 @@ +<?php + +use OCP\AppFramework as OAF; + +/** + * Class BadClass - creating an instance of a blacklisted class is not allowed + */ +class BadClass implements OAF\IApi { +} diff --git a/tests/data/app/code-checker/test-deprecated-use-sub.php b/tests/data/app/code-checker/test-deprecated-use-sub.php new file mode 100644 index 00000000000..a53e9a7229e --- /dev/null +++ b/tests/data/app/code-checker/test-deprecated-use-sub.php @@ -0,0 +1,9 @@ +<?php + +use OCP\AppFramework; + +/** + * Class BadClass - creating an instance of a blacklisted class is not allowed + */ +class BadClass implements AppFramework\IApi { +} diff --git a/tests/data/app/code-checker/test-deprecated-use.php b/tests/data/app/code-checker/test-deprecated-use.php new file mode 100644 index 00000000000..ebf2c90bc5a --- /dev/null +++ b/tests/data/app/code-checker/test-deprecated-use.php @@ -0,0 +1,9 @@ +<?php + +use OCP\AppFramework\IApi; + +/** + * Class BadClass - creating an instance of a blacklisted class is not allowed + */ +class BadClass implements IApi { +} diff --git a/tests/data/app/code-checker/test-use.php b/tests/data/app/code-checker/test-use.php new file mode 100644 index 00000000000..9c4824f9767 --- /dev/null +++ b/tests/data/app/code-checker/test-use.php @@ -0,0 +1,12 @@ +<?php + +use OC_AppConfig as UseConfig; + +/** + * Class BadClass - creating an instance of a blacklisted class is not allowed + */ +class BadClass { + public function foo() { + $bar = new UseConfig(); + } +} |