summaryrefslogtreecommitdiffstats
path: root/tests/data/app
diff options
context:
space:
mode:
Diffstat (limited to 'tests/data/app')
-rw-r--r--tests/data/app/code-checker/test-const.php10
-rw-r--r--tests/data/app/code-checker/test-extends.php8
-rw-r--r--tests/data/app/code-checker/test-implements.php9
-rw-r--r--tests/data/app/code-checker/test-new.php10
-rw-r--r--tests/data/app/code-checker/test-static-call.php10
5 files changed, 47 insertions, 0 deletions
diff --git a/tests/data/app/code-checker/test-const.php b/tests/data/app/code-checker/test-const.php
new file mode 100644
index 00000000000..2af6baf2f3d
--- /dev/null
+++ b/tests/data/app/code-checker/test-const.php
@@ -0,0 +1,10 @@
+<?php
+
+/**
+ * Class BadClass - accessing consts on blacklisted classes is not allowed
+ */
+class BadClass {
+ public function foo() {
+ $bar = OC_API::ADMIN_AUTH;
+ }
+}
diff --git a/tests/data/app/code-checker/test-extends.php b/tests/data/app/code-checker/test-extends.php
new file mode 100644
index 00000000000..39d29da92dc
--- /dev/null
+++ b/tests/data/app/code-checker/test-extends.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * Class BadClass - sub class a forbidden class is not allowed
+ */
+class BadClass extends OC_Hook {
+
+}
diff --git a/tests/data/app/code-checker/test-implements.php b/tests/data/app/code-checker/test-implements.php
new file mode 100644
index 00000000000..3bf2f959b52
--- /dev/null
+++ b/tests/data/app/code-checker/test-implements.php
@@ -0,0 +1,9 @@
+<?php
+
+/**
+ * Class BadClass - sub class a forbidden class is not allowed
+ * NOTE: lowercase typo is intended
+ */
+class BadClass implements oC_Avatar {
+
+}
diff --git a/tests/data/app/code-checker/test-new.php b/tests/data/app/code-checker/test-new.php
new file mode 100644
index 00000000000..0522d473d96
--- /dev/null
+++ b/tests/data/app/code-checker/test-new.php
@@ -0,0 +1,10 @@
+<?php
+
+/**
+ * Class BadClass - creating an instance of a blacklisted class is not allowed
+ */
+class BadClass {
+ public function foo() {
+ $bar = new OC_AppConfig();
+ }
+}
diff --git a/tests/data/app/code-checker/test-static-call.php b/tests/data/app/code-checker/test-static-call.php
new file mode 100644
index 00000000000..4afe0b1174d
--- /dev/null
+++ b/tests/data/app/code-checker/test-static-call.php
@@ -0,0 +1,10 @@
+<?php
+
+/**
+ * Class BadClass - calling static methods on blacklisted classes is not allowed
+ */
+class BadClass {
+ public function foo() {
+ OC_App::isEnabled('bar');
+ }
+}