API Update composer requirements, Travis configuration, add phpcs/phpunit config and remove compass config

This commit is contained in:
Robbie Averill 2017-08-09 11:48:10 +12:00
parent 2e809de2ea
commit e11cbc5cfc
7 changed files with 58 additions and 43 deletions

View File

@ -1,33 +1,32 @@
# See https://github.com/silverstripe/silverstripe-travis-support for setup details
sudo: false
language: php
env:
global:
- COMPOSER_ROOT_VERSION=4.0.x-dev
matrix:
include:
- php: 5.3
env: DB=MYSQL CORE_RELEASE=3.4
- php: 5.4
env: DB=MYSQL CORE_RELEASE=3.5
- php: 5.6
env: DB=MYSQL CORE_RELEASE=3
- php: 5.6
env: DB=MYSQL CORE_RELEASE=3.5 SECUREASSETS=1
env: DB=MYSQL PHPCS_TEST=1 PHPUNIT_TEST=1
- php: 7.0
env: DB=MYSQL PHPUNIT_TEST=1
- php: 7.1
env: DB=MYSQL CORE_RELEASE=3.6
env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1
before_script:
- git clone git://github.com/silverstripe/silverstripe-travis-support.git ~/travis-support
- "if [ \"$SECUREASSETS\" = \"\" ]; then php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss; fi"
- "if [ \"$SECUREASSETS\" = \"1\" ]; then php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss --require silverstripe/secureassets; fi"
- cd ~/builds/ss
# Init PHP
- phpenv rehash
- phpenv config-rm xdebug.ini
# Install composer dependencies
- composer install --prefer-dist
- composer require --prefer-dist --no-update silverstripe/framework:4.0.x-dev silverstripe/cms:4.0.x-dev silverstripe/admin:1.0.x-dev silverstripe/versioned:1.0.x-dev
- composer update
script:
- vendor/bin/phpunit --coverage-clover coverage.clover userforms/tests
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit; fi
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml; fi
- if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs code/ tests/; fi
after_success:
- mv coverage.clover ~/build/$TRAVIS_REPO_SLUG/
- cd ~/build/$TRAVIS_REPO_SLUG
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi

View File

@ -1,7 +1 @@
<?php
if (!defined('USERFORMS_DIR')) {
define('USERFORMS_DIR', basename(__DIR__));
}
Deprecation::notification_version('3.0', 'userforms');

View File

@ -1,12 +0,0 @@
require 'compass/import-once/activate'
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "scss"
images_dir = "images"
javascripts_dir = "javascript"
line_comments = false

View File

@ -1,4 +1,4 @@
Copyright (c) 2016, SilverStripe Limited
Copyright (c) 2017, SilverStripe Limited
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

21
phpcs.xml.dist Normal file
View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="SilverStripe">
<description>CodeSniffer ruleset for SilverStripe coding conventions.</description>
<!-- base rules are PSR-2 -->
<rule ref="PSR2" >
<!-- Current exclusions -->
<exclude name="PSR1.Methods.CamelCapsMethodName" />
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols" />
<exclude name="PSR2.Classes.PropertyDeclaration" />
<exclude name="PSR2.ControlStructures.SwitchDeclaration" /> <!-- causes php notice while linting -->
<exclude name="PSR2.ControlStructures.SwitchDeclaration.WrongOpenercase" />
<exclude name="PSR2.ControlStructures.SwitchDeclaration.WrongOpenerdefault" />
<exclude name="PSR2.ControlStructures.SwitchDeclaration.TerminatingComment" />
<exclude name="PSR2.Methods.MethodDeclaration.Underscore" />
<exclude name="Squiz.Scope.MethodScope" />
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps" />
<exclude name="Generic.Files.LineLength.TooLong" />
<exclude name="PEAR.Functions.ValidDefaultValue.NotAtEnd" />
</rule>
</ruleset>

13
phpunit.xml.dist Normal file
View File

@ -0,0 +1,13 @@
<phpunit bootstrap="cms/tests/bootstrap.php" colors="true">
<testsuite name="Default">
<directory>tests/</directory>
</testsuite>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">code/</directory>
<exclude>
<directory suffix=".php">tests/</directory>
</exclude>
</whitelist>
</filter>
</phpunit>

View File

@ -3,9 +3,9 @@
UserForms enables CMS users to create dynamic forms via a drag and drop interface
and without getting involved in any PHP code.
[![Build Status](http://img.shields.io/travis/silverstripe/silverstripe-userforms.svg?style=flat-square)](https://travis-ci.org/silverstripe/silverstripe-userforms)
[![Code Quality](http://img.shields.io/scrutinizer/g/silverstripe/silverstripe-userforms.svg?style=flat-square)](https://scrutinizer-ci.com/g/silverstripe/silverstripe-userforms)
[![Code Coverage](http://img.shields.io/scrutinizer/coverage/g/silverstripe/silverstripe-userforms.svg?style=flat-square)](https://scrutinizer-ci.com/g/silverstripe/silverstripe-userforms)
[![Build Status](https://travis-ci.org/silverstripe/silverstripe-userforms.svg?branch=master)](https://travis-ci.org/silverstripe/silverstripe-userforms)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/silverstripe/silverstripe-userforms/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/silverstripe/silverstripe-userforms/?branch=master)
[![codecov](https://codecov.io/gh/silverstripe/silverstripe-userforms/branch/master/graph/badge.svg)](https://codecov.io/gh/silverstripe/silverstripe-userforms)
[![Version](http://img.shields.io/packagist/v/silverstripe/userforms.svg?style=flat-square)](https://packagist.org/packages/silverstripe/silverstripe-userforms)
[![License](http://img.shields.io/packagist/l/silverstripe/userforms.svg?style=flat-square)](LICENSE.md)
![helpfulrobot](https://helpfulrobot.io/silverstripe/userforms/badge)