Cleaned up tests and Badges

This commit is contained in:
Christopher Pitt 2015-10-29 10:32:00 +13:00
parent 93a60eb455
commit 119e6e59d8
5 changed files with 36 additions and 89 deletions

View File

@ -1,71 +1,9 @@
filter:
excluded_paths:
- 'vendor/*'
- 'tests/*'
- 'bin/*'
- 'library/*'
paths: [ 'timeline/*']
tools:
js_hint: true
php_analyzer:
enabled: true
extensions:
- php
filter:
excluded_paths:
- 'vendor/*'
- 'tests/*'
- 'bin/*'
paths: { }
path_configs: { }
php_cpd:
enabled: true
excluded_dirs: { }
names:
- '*.php'
min_lines: 5
min_tokens: 70
filter:
excluded_paths:
- 'vendor/*'
- 'tests/*'
- 'app/*'
- 'bin/*'
paths: { }
php_pdepend:
enabled: true
configuration_file: null
suffixes:
- php
excluded_dirs: { }
filter:
excluded_paths:
- 'vendor/*'
- 'tests/*'
- 'app/*'
- 'bin/*'
paths: { }
external_code_coverage:
enabled: true
timeout: 300
filter:
excluded_paths:
- 'vendor/*'
- 'tests/*'
- 'app/*'
- 'bin/*'
paths: { }
sensiolabs_security_checker: true
php_loc:
enabled: true
excluded_dirs: [vendor, tests]
inherit: true
changetracking:
bug_patterns:
- '\bfix(?:es|ed)?\b'
feature_patterns:
- '\badd(?:s|ed)?\b'
- '\bimplement(?:s|ed)?\b'
before_commands: { }
after_commands: { }
artifacts: { }
checks:
php:
code_rating: true
duplication: true
filter:
paths: [code/*, tests/*]

View File

@ -1,24 +1,32 @@
# See https://github.com/silverstripe-labs/silverstripe-travis-support for setup details
language: php
php:
- 5.3
sudo: false
env:
- DB=MYSQL CORE_RELEASE=3.1
- DB=PGSQL CORE_RELEASE=3.1
language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
env: DB=MYSQL CORE_RELEASE=3.2
matrix:
include:
- php: 5.4
- php: 5.6
env: DB=MYSQL CORE_RELEASE=3.1
- php: 5.6
env: DB=PGSQL CORE_RELEASE=3.1
- php: 5.6
env: DB=PGSQL CORE_RELEASE=3.2
before_script:
- git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support
- php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss --require silverstripe/cms
- cd ~/builds/ss
- composer self-update || true
- git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support
- php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss
- cd ~/builds/ss
- composer install
script:
- phpunit --coverage-clover=coverage.clover
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover --repository=g/silverstripe-labs/silverstripe-contentreview --revision=`cd contentreview && git rev-parse HEAD`
- phpunit contentreview/tests

View File

@ -1,8 +1,9 @@
# Content Review module
[![Build Status](https://travis-ci.org/silverstripe-labs/silverstripe-contentreview.png?branch=feature_improvements)](https://travis-ci.org/silverstripe-labs/silverstripe-contentreview)
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/silverstripe-labs/silverstripe-contentreview/badges/quality-score.png?s=e68f2c583f03c7eab0326781f6219f0ed58c9ad8)](https://scrutinizer-ci.com/g/silverstripe-labs/silverstripe-contentreview/)
[![Code Coverage](https://scrutinizer-ci.com/g/silverstripe-labs/silverstripe-contentreview/badges/coverage.png?s=42151d66ef5121363face01c03c94dc479baa408)](https://scrutinizer-ci.com/g/silverstripe-labs/silverstripe-contentreview/)
[![Build Status](http://img.shields.io/travis/silverstripe/silverstripe-contentreview.svg?style=flat-square)](https://travis-ci.org/silverstripe/silverstripe-contentreview)
[![Code Quality](http://img.shields.io/scrutinizer/g/silverstripe/silverstripe-contentreview.svg?style=flat-square)](https://scrutinizer-ci.com/g/silverstripe/silverstripe-contentreview)
[![Version](http://img.shields.io/packagist/v/silverstripe/contentreview.svg?style=flat-square)](https://packagist.org/packages/silverstripe/silverstripe-contentreview)
[![License](http://img.shields.io/packagist/l/silverstripe/contentreview.svg?style=flat-square)](LICENSE.md)
This module helps keep your website content accurate and up-to-date, which keeps your users happy.

View File

@ -27,7 +27,7 @@ class ContentReviewCMSExtension extends LeftAndMainExtension {
if(!isset($data['ID'])) {
throw new SS_HTTPResponse_Exception("No record ID", 404);
}
$SQL_id = Convert::raw2sql($data['ID']);
$SQL_id = (int) $data['ID'];
$record = SiteTree::get()->byID($SQL_id);
if(!$record || !$record->ID) {
@ -67,7 +67,7 @@ class ContentReviewCMSExtension extends LeftAndMainExtension {
if(!isset($data['ID'])) {
throw new SS_HTTPResponse_Exception("No record ID", 404);
}
$SQL_id = Convert::raw2sql($data['ID']);
$SQL_id = (int) $data['ID'];
$page = SiteTree::get()->byID($SQL_id);
if($page && !$page->canEdit()) {
return Security::permissionFailure();

View File

@ -20,7 +20,7 @@ class ContentReviewCMSPageEditControllerTest extends ContentReviewBaseTest {
}
public function testReviewedThrowsExceptionWithWrongRecordID() {
$this->setExpectedException('SS_HTTPResponse_Exception', 'Bad record ID #FAIL', 404);
$this->setExpectedException('SS_HTTPResponse_Exception');
$controller = new CMSPageEditController();
$dummyForm = new CMSForm($controller, 'EditForm', new FieldList(), new FieldList());
$controller->reviewed(array('ID'=>'FAIL', 'Message' => null), $dummyForm);