Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions .distignore

This file was deleted.

18 changes: 1 addition & 17 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,10 @@ jobs:
- name: Check out source code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: latest
coverage: none
tools: wp-cli

- name: Install latest version of dist-archive-command
run: wp package install wp-cli/dist-archive-command:v3.1.0

- name: Build plugin
run: |
wp dist-archive . ./rsscloud.zip --plugin-dirname=rsscloud
mkdir tmp-build
unzip rsscloud.zip -d tmp-build

- name: Run plugin check
uses: wordpress/plugin-check-action@v1
with:
build-dir: "./tmp-build/rsscloud"
build-dir: "./rsscloud"

phpunit:
name: Run tests
Expand Down
4 changes: 1 addition & 3 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
<description>Generally-applicable sniffs for WordPress plugins.</description>

<!-- What to scan -->
<file>.</file>
<exclude-pattern>/vendor/</exclude-pattern>
<exclude-pattern>/node_modules/</exclude-pattern>
<file>./rsscloud</file>

<!-- How to scan -->
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
Expand Down
7 changes: 5 additions & 2 deletions .wp-env.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
"$schema": "https://schemas.wp.org/trunk/wp-env.json",
"testsEnvironment": false,
"core": "WordPress/WordPress#6.3",
"plugins": ["."],
"plugins": ["./rsscloud"],
"phpVersion": "7.4",
"phpmyadminPort": 9000
"phpmyadminPort": 9000,
"mappings": {
"wp-content/plugins/rsscloud-dev": "."
}
}
5 changes: 4 additions & 1 deletion .wp-env.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
"testsEnvironment": false,
"port": 8889,
"core": "WordPress/WordPress#6.3",
"plugins": ["."],
"plugins": ["./rsscloud"],
"config": {
"WP_DEBUG": false,
"SCRIPT_DEBUG": false
},
"mappings": {
"wp-content/plugins/rsscloud-dev": "."
}
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
"scripts": {
"lint:php:setup": "wp-env start",
"preformat:php": "npm-run-all lint:php:setup other:update-packages:php",
"format:php": "wp-env run --env-cwd='wp-content/plugins/rsscloud' cli composer run-script format",
"format:php": "wp-env run --env-cwd='wp-content/plugins/rsscloud-dev' cli composer run-script format",
"prelint:php": "npm-run-all lint:php:setup other:update-packages:php",
"lint:php": "wp-env run --env-cwd='wp-content/plugins/rsscloud' cli composer run-script lint",
"other:update-packages:php": "wp-env run --env-cwd='wp-content/plugins/rsscloud' cli composer update --no-interaction",
"lint:php": "wp-env run --env-cwd='wp-content/plugins/rsscloud-dev' cli composer run-script lint",
"other:update-packages:php": "wp-env run --env-cwd='wp-content/plugins/rsscloud-dev' cli composer update --no-interaction",
"test:php": "npm-run-all lint:php test:unit:php",
"test:unit:php:setup": "wp-env --config .wp-env.test.json start",
"test:unit:php:setup:debug": "wp-env --config .wp-env.test.json start --xdebug",
"test:unit:php:base": "wp-env --config .wp-env.test.json run --env-cwd='wp-content/plugins/rsscloud' wordpress vendor/bin/phpunit -c phpunit.xml.dist --verbose --testdox",
"test:unit:php:base": "wp-env --config .wp-env.test.json run --env-cwd='wp-content/plugins/rsscloud-dev' wordpress vendor/bin/phpunit -c phpunit.xml.dist --verbose --testdox",
"test:unit:php": "npm-run-all test:unit:php:setup test:unit:php:base",
"test:unit:php:debug": "npm-run-all test:unit:php:setup:debug test:unit:php:base",
"test:unit:php:setup:coverage": "wp-env --config .wp-env.test.json start --xdebug=coverage",
"test:unit:php:coverage:base": "wp-env --config .wp-env.test.json run --env-cwd='wp-content/plugins/rsscloud' wordpress vendor/bin/phpunit -c phpunit.xml.dist --verbose --coverage-html coverage --coverage-clover coverage/clover.xml",
"test:unit:php:coverage:base": "wp-env --config .wp-env.test.json run --env-cwd='wp-content/plugins/rsscloud-dev' wordpress vendor/bin/phpunit -c phpunit.xml.dist --verbose --coverage-html coverage --coverage-clover coverage/clover.xml",
"test:unit:php:coverage": "npm-run-all test:unit:php:setup:coverage test:unit:php:coverage:base"
}
}
6 changes: 1 addition & 5 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@
<description>Generally-applicable sniffs for WordPress plugins</description>

<rule ref="WordPress-Core" />
<rule ref="WordPress-Docs" />

<!-- Check all PHP files in directory tree by default. -->
<arg name="extensions" value="php"/>
<file>.</file>
<file>./rsscloud</file>

<!-- Show progress and sniff codes in all reports -->
<arg value="ps"/>

<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
</ruleset>
7 changes: 1 addition & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">.</directory>
<directory suffix=".php">./rsscloud</directory>
</include>
<exclude>
<directory>./tests</directory>
<directory>./vendor</directory>
<directory>./node_modules</directory>
</exclude>
</coverage>
</phpunit>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* Manually load the plugin being tested.
*/
function _manually_load_plugin() {
require dirname( __DIR__, 1 ) . '/rsscloud.php';
require dirname( __DIR__, 1 ) . '/rsscloud/rsscloud.php';
}

tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
Expand Down
Loading