Browse Source

refactor(package): move plugin files into ./src directory

separate app from plugin code for easier deployments

closes #36
Josh Habdas 2 years ago
parent
commit
a6a8a27763

+ 6
- 3
.codeclimate.yml View File

@@ -17,7 +17,10 @@ engines:
17 17
       rulesets: "cleancode,codesize,design,naming,unusedcode"
18 18
 ratings:
19 19
   paths:
20
-  - "**.php"
20
+    - "src/**.php"
21
+    - "tests/**.spec.php"
21 22
 exclude_paths:
22
-- node_modules/
23
-- "**/vendor/**/*"
23
+  - "src/**/*"
24
+  - "!src/**.php"
25
+  - node_modules/
26
+  - "**/vendor/**/*"

+ 6
- 0
composer.json View File

@@ -18,5 +18,11 @@
18 18
   },
19 19
   "require-dev": {
20 20
     "codeclimate/php-test-reporter": "dev-master"
21
+  },
22
+  "autoload": {
23
+    "psr-4": { "": "src/" }
24
+  },
25
+  "autoload-dev": {
26
+    "psr-4": { "": "tests/" }
21 27
   }
22 28
 }

+ 2
- 2
phpunit.xml.dist View File

@@ -8,7 +8,7 @@
8 8
   >
9 9
   <testsuites>
10 10
     <testsuite>
11
-      <directory prefix="test-" suffix=".php">./tests/</directory>
11
+      <directory suffix=".spec.php">./tests/</directory>
12 12
     </testsuite>
13 13
   </testsuites>
14 14
   <logging>
@@ -16,7 +16,7 @@
16 16
   </logging>
17 17
   <filter>
18 18
     <whitelist processUncoveredFilesFromWhitelist="true">
19
-      <file>./hyperdrive.php</file>
19
+      <directory suffix=".php">./src/</directory>
20 20
     </whitelist>
21 21
   </filter>
22 22
 </phpunit>

assets/banner-1544x500.png → src/assets/banner-1544x500.png View File


assets/banner-772x250.png → src/assets/banner-772x250.png View File


assets/icon-128x128.png → src/assets/icon-128x128.png View File


assets/icon-256x256.png → src/assets/icon-256x256.png View File


hyperdrive.php → src/hyperdrive.php View File


readme.txt → src/readme.txt View File


+ 1
- 1
tests/bootstrap.php View File

@@ -17,7 +17,7 @@ require_once $_tests_dir . '/includes/functions.php';
17 17
  * Manually load the plugin being tested.
18 18
  */
19 19
 function _manually_load_plugin() {
20
-	require dirname( dirname( __FILE__ ) ) . '/hyperdrive.php';
20
+	require dirname( dirname( __FILE__ ) ) . '/src/hyperdrive.php';
21 21
 }
22 22
 tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
23 23
 

tests/test-sample.php → tests/sample.spec.php View File


Loading…
Cancel
Save