Skip to content

Commit

Permalink
Add Test Reporting and Apply WPCS (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparsd authored Dec 5, 2018
1 parent 9389b65 commit e9b1839
Show file tree
Hide file tree
Showing 17 changed files with 537 additions and 735 deletions.
3 changes: 3 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
service_name: travis-ci
coverage_clover: tests/logs/clover.xml
json_path: tests/logs/coveralls-upload.json
17 changes: 4 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
language: php

php:
- 7.0
- 7.2
- 5.6

env:
- WP_VERSION=latest DEV_LIB_PATH=vendor/xwp/wp-dev-lib WP_ORG_SLUG=widget-context

addons:
apt:
packages:
- libxml2-utils # For xmllint.

install:
- npm install
- composer install
- source $DEV_LIB_PATH/travis.install.sh

script:
- source $DEV_LIB_PATH/travis.script.sh
- composer lint
- composer test

after_script:
- source $DEV_LIB_PATH/travis.after_script.sh
- vendor/bin/php-coveralls -v

notifications:
email: false
112 changes: 0 additions & 112 deletions class/modules/word-count/module.php

This file was deleted.

16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@
"issues": "https://github.com/kasparsd/widget-context-wporg/issues",
"source": "https://github.com/kasparsd/widget-context-wporg"
},
"minimum-stability": "dev",
"require-dev": {
"squizlabs/php_codesniffer": "^3.2",
"wp-coding-standards/wpcs": "^0.14.1",
"xwp/wp-dev-lib": "dev-master#c6992d73368ce58b92b56811d78f72bc9df95654",
"phpunit/phpunit": "^5"
"wp-coding-standards/wpcs": "^1.2.0",
"phpunit/phpunit": "^5",
"php-coveralls/php-coveralls": "^2.1.0"
},
"autoload": {
"classmap": [
"class/"
"src/"
]
},
"scripts": {
"lint": [
"vendor/bin/phpcs ."
],
"test": [
"DEV_LIB_SKIP=phpunit DIFF_BASE=master ./vendor/xwp/wp-dev-lib/pre-commit",
"./vendor/bin/phpunit"
"vendor/bin/phpunit"
],
"post-install-cmd": [
"npm install"
Expand Down
109 changes: 0 additions & 109 deletions debug/debug-bar.php

This file was deleted.

8 changes: 0 additions & 8 deletions debug/debug.js

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"homepage": "https://widgetcontext.com",
"author": {
"name": "Kaspars Dambis",
"url": "https://kaspars.net"
"url": "https://preseto.com"
},
"scripts": {
"grunt": "grunt",
"build": "grunt build",
"deploy": "grunt deploy",
"deploy-trunk": "grunt deploy-trunk",
"precommit": "composer test"
"precommit": "composer lint && composer test"
},
"repository": {
"type": "git",
Expand Down
10 changes: 9 additions & 1 deletion phpcs.xml → phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards for Plugins">
<config name="installed_paths" value="vendor/wp-coding-standards/wpcs" />
<config name="ignore_warnings_on_exit" value="1" />

<arg name="extensions" value="php" />
<arg name="colors" />
<arg value="s" /><!-- Show sniff codes in all reports. -->

<rule ref="WordPress-Core">
<exclude name="WordPress.Files.FileName" /><!-- We'll be switching to PSR-4 naming soon. -->
<exclude name="Generic.Formatting.MultipleStatementAlignment" />
<exclude name="WordPress.Arrays.MultipleStatementAlignment" />
</rule>

<!--
<rule ref="WordPress-Docs">
<exclude name="Squiz.Commenting.FileComment" />
</rule>
-->

<exclude-pattern>/node_modules</exclude-pattern>
<exclude-pattern>/tests</exclude-pattern>
<exclude-pattern>/vendor</exclude-pattern>
</ruleset>
14 changes: 13 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
<phpunit
colors="true"
bootstrap="tests/php/bootstrap.php"
>
>

<testsuites>
<testsuite name="Widget Context Tests">
<directory>tests/php</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src/</directory>
</whitelist>
</filter>

<logging>
<log type="coverage-clover" target="tests/logs/clover.xml"/>
</logging>

</phpunit>
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Widget Context

[![Build Status](https://travis-ci.org/kasparsd/widget-context-wporg.svg?branch=master)](https://travis-ci.org/kasparsd/widget-context-wporg)
[![Coverage Status](https://coveralls.io/repos/github/kasparsd/widget-context-wporg/badge.svg?branch=master)](https://coveralls.io/github/kasparsd/widget-context-wporg?branch=master)

Source of the [Widget Context plugin](https://widgetcontext.com) for WordPress.

Expand Down
Loading

0 comments on commit e9b1839

Please sign in to comment.