Skip to content

Commit

Permalink
add PSR formatting & syntax tests
Browse files Browse the repository at this point in the history
  • Loading branch information
notslang committed Mar 7, 2016
1 parent 5f2965a commit 79afb9d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: php
php:
- '5.6'
- nightly
install: composer install
script: composer test
6 changes: 6 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@
"keywords": ["plugin","wordpress","wp-sync-db","media"],
"require": {
"composer/installers": "~1.0.6"
},
"require-dev": {
"phpfmt/fmt": "^19.6"
},
"scripts": {
"test": "./test.sh"
}
}
11 changes: 11 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -e
set -o pipefail

files=(*.php class/*.php template/*.php);
for file in "${files[@]}"
do
php -l "$file";
php vendor/phpfmt/fmt/fmt.phar --psr1 --psr2 -o=- "$file" | diff -U3 \
--label "$file (correct formatting)" --label "$file (original)" - "$file";
done

0 comments on commit 79afb9d

Please sign in to comment.