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
3 changes: 0 additions & 3 deletions .coveralls.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: PHP Composer

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.0', '7.1', '7.2', '7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run PHPCS
run: composer run-script lint
- name: Run PHPUnit
run: composer run-script test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/vendor/
/clover.xml
composer.lock
.phpunit.result.cache
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# DWS Coding Standard
[![Build Status](https://travis-ci.org/traderinteractive/dws-coding-standard.svg?branch=master)](https://travis-ci.org/traderinteractive/dws-coding-standard)
[![Coverage Status](https://coveralls.io/repos/github/traderinteractive/dws-coding-standard/badge.svg)](https://coveralls.io/github/traderinteractive/dws-coding-standard)

[![Latest Stable Version](https://poser.pugx.org/traderinteractive/coding-standard/v/stable)](https://packagist.org/packages/traderinteractive/coding-standard)
[![Latest Unstable Version](https://poser.pugx.org/traderinteractive/coding-standard/v/unstable)](https://packagist.org/packages/traderinteractive/coding-standard)
[![License](https://poser.pugx.org/traderinteractive/coding-standard/license)](https://packagist.org/packages/traderinteractive/coding-standard)
Expand Down Expand Up @@ -31,8 +28,8 @@ Then to use it, you can run the following (or add to your build process):

Developers may be contacted at:

* [Pull Requests](https://github.com/traderinteractive/dws-coding-standard/pulls)
* [Issues](https://github.com/traderinteractive/dws-coding-standard/issues)
* [Pull Requests](https://github.com/traderinteractive/coding-standard-php/pulls)
* [Issues](https://github.com/traderinteractive/coding-standard-php/issues)

## Tests

Expand Down
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@
"sort-packages": true
},
"require": {
"php": "^5.6 || ^7.0",
"php": "^7.0",
"squizlabs/php_codesniffer": "^2.6"
},
"require-dev": {
"php-coveralls/php-coveralls": "^1.0",
"phpunit/phpunit": "^5.5"
"phpunit/phpunit": ">=6"
},
"scripts": {
"lint": "vendor/bin/phpcs",
"test": "vendor/bin/phpunit"
}
}
9 changes: 9 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<ruleset name="PHP_CodeSniffer">
<file>.</file>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*.inc</exclude-pattern>
<arg name="colors"/>
<arg value="np"/>
<rule ref="DWS"/>
</ruleset>
22 changes: 9 additions & 13 deletions tests/AbstractSniffUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* @package PHP_CodeSniffer
*/

use PHPUnit\Framework\TestCase;

/**
* An abstract class that all sniff unit tests must extend.
*
Expand All @@ -16,7 +18,7 @@
* @category PHP
* @package PHP_CodeSniffer
*/
abstract class AbstractSniffUnitTest extends PHPUnit_Framework_TestCase
abstract class AbstractSniffUnitTest extends TestCase
{
/**
* The PHP_CodeSniffer object used for testing.
Expand All @@ -26,27 +28,19 @@ abstract class AbstractSniffUnitTest extends PHPUnit_Framework_TestCase
protected static $_phpcs = null;

/**
* Sets up this unit test.
* Tests the extending classes Sniff class.
*
* @return void
* @throws PHPUnit_Framework_Error
* @test
*/
protected function setUp()
public final function runTest()
{
if (self::$_phpcs === null) {
self::$_phpcs = new PHP_CodeSniffer();
self::$_phpcs->cli->setCommandLineValues(['-s']);
}
}

/**
* Tests the extending classes Sniff class.
*
* @return void
* @throws PHPUnit_Framework_Error
* @test
*/
public final function runTest()
{
self::$_phpcs->process([], 'DWS', [$this->_getSniffName()]);
self::$_phpcs->setIgnorePatterns([]);

Expand All @@ -72,6 +66,8 @@ public final function runTest()
if (count($failureMessages) > 0) {
$this->fail(implode("\n", $failureMessages));
}

$this->assertEmpty($failureMessages);
}

/**
Expand Down