Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

Commit

Permalink
Added Grunt.
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Aug 19, 2014
1 parent 21b9924 commit df34c03
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 13 deletions.
14 changes: 8 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Build
/build
/build/

# Composer
/vendor
composer.lock
/vendor/

# Eclipse
.buildpath
.project
.settings
/.buildpath
/.project
/.settings

# Node.js
/node_modules/
54 changes: 54 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
module.exports = function( grunt ) {
// Project configuration.
grunt.initConfig( {
// Package
pkg: grunt.file.readJSON( 'package.json' ),

// JSHint
jshint: {
all: [ 'Gruntfile.js', 'composer.json', 'package.json' ]
},

// PHP Code Sniffer
phpcs: {
application: {
dir: [ './' ],
},
options: {
standard: 'phpcs.ruleset.xml',
extensions: 'php',
ignore: 'node_modules'
}
},

// PHPLint
phplint: {
options: {
phpArgs: {
'-lf': null
}
},
all: [ '**/*.php' ]
},

// PHP Mess Detector
phpmd: {
application: {
dir: '.'
},
options: {
exclude: 'node_modules',
reportFormat: 'xml',
rulesets: 'phpmd.ruleset.xml'
}
},
} );

grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-phpcs' );
grunt.loadNpmTasks( 'grunt-phplint' );
grunt.loadNpmTasks( 'grunt-phpmd' );

// Default task(s).
grunt.registerTask( 'default', [ 'jshint', 'phplint', 'phpmd', 'phpcs' ] );
};
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "OmniKassa driver for the WordPress payment processing library.",
"keywords": ["wordpress", "wp", "pay", "omnikassa", "gateway", "pronamic"],
"homepage": "http://www.wp-pay.org/gateways/omnikassa/",
"license": "GPL-3.0+",
"license": "GPL",
"authors": [
{
"name": "Pronamic",
Expand Down
41 changes: 41 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "omnikassa",
"version": "1.0.0",
"description": "OmniKassa driver for the WordPress payment processing library.",
"repository": {
"type": "git",
"url": "https://github.com/wp-pay-gateways/omnikassa"
},
"keywords": [
"wordpress",
"wp",
"pay",
"omnikassa",
"gateway",
"pronamic"
],
"author": {
"name": "Pronamic",
"email": "info@pronamic.nl",
"url": "http://www.pronamic.nl/"
},
"contributors": [
{
"name": "Remco Tolsma",
"email": "info@remcotolsma.nl",
"url": "http://www.remcotolsma.nl/"
}
],
"license": "GPL",
"bugs": {
"url": "https://github.com/wp-pay-gateways/omnikassa/issues"
},
"homepage": "http://www.wp-pay.org/gateways/omnikassa/",
"devDependencies": {
"grunt": "~0.4.5",
"grunt-phplint": "0.0.5",
"grunt-phpmd": "^0.1.0",
"grunt-phpcs": "^0.2.3",
"grunt-contrib-jshint": "^0.10.0"
}
}
6 changes: 6 additions & 0 deletions phpcs.ruleset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0"?>
<ruleset name="WordPress Pay OmniKassa rules">
<rule ref="WordPress">

</rule>
</ruleset>
22 changes: 22 additions & 0 deletions phpmd.ruleset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>

<ruleset name="WordPress Pay OmniKassa rules"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"
>
<rule ref="rulesets/cleancode.xml">
<exclude name="StaticAccess" />
</rule>

<rule ref="rulesets/codesize.xml" />

<rule ref="rulesets/design.xml" />

<rule ref="rulesets/naming.xml" />

<rule ref="rulesets/unusedcode.xml">
<exclude name="UnusedFormalParameter" />
</rule>
</ruleset>
11 changes: 5 additions & 6 deletions tests/ResponseCodesTest.php
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
<?php

/**
* Title: Mollie statuses constants tests
* Title: OmniKassa response codes test
* Description:
* Copyright: Copyright (c) 2005 - 2014
* Company: Pronamic
* @author Remco Tolsma
* @version 1.0.0
* @see https://www.mollie.nl/support/documentatie/betaaldiensten/ideal/en/
*/
class Pronamic_WP_Pay_OmniKassa_ResponseCodesTest extends PHPUnit_Framework_TestCase {
/**
* @dataProvider statusMatrixProvider
* @dataProvider status_matrix_provider
*/
public function testTransform( $responseCode, $expected ) {
public function test_transform( $responseCode, $expected ) {
$status = Pronamic_WP_Pay_OmniKassa_ResponseCodes::transform( $responseCode );

$this->assertEquals( $expected, $status );
}

public function statusMatrixProvider() {
public function status_matrix_provider() {
return array(
array( Pronamic_WP_Pay_OmniKassa_ResponseCodes::TRANSACTION_SUCCES, Pronamic_WP_Pay_Statuses::SUCCESS ),
array( Pronamic_WP_Pay_OmniKassa_ResponseCodes::AUTHORIZATION_LIMIT, Pronamic_WP_Pay_Statuses::FAILURE ),
Expand All @@ -29,5 +28,5 @@ public function statusMatrixProvider() {
array( Pronamic_WP_Pay_OmniKassa_ResponseCodes::REQUEST_TIMEOUT, Pronamic_WP_Pay_Statuses::EXPIRED ),
array( 'not existing response code', null ),
);
}
}
}

0 comments on commit df34c03

Please sign in to comment.