From c6f89733423cd43a6588be723f7b1e1af40e4b12 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Tue, 12 Dec 2017 17:03:04 +1300 Subject: [PATCH] NEW Convert to vendor module, add table_name to test stubs and add PHP 7.2 to travis --- .gitattributes | 1 + .travis.yml | 4 +++- composer.json | 10 +++++++--- tests/Stubs/CommentableItemController.php | 1 - tests/Stubs/CommentableItemDisabled.php | 4 ++-- tests/Stubs/CommentableItemEnabled.php | 4 ++-- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.gitattributes b/.gitattributes index 475f5f2..89eb187 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,3 +4,4 @@ /.gitignore export-ignore /.travis.yml export-ignore /.scrutinizer.yml export-ignore +/codecov.yml export-ignore diff --git a/.travis.yml b/.travis.yml index 72230bd..bd7316f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,8 @@ matrix: env: DB=PGSQL PHPUNIT_TEST=1 - php: 7.1 env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1 + - php: 7.2 + env: DB=MYSQL PHPUNIT_TEST=1 before_script: - phpenv rehash @@ -21,7 +23,7 @@ before_script: script: - 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 --standard=vendor/silverstripe/framework/phpcs.xml.dist src/ tests/ ; fi + - if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs src/ tests/ *.php; fi after_success: - if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi diff --git a/composer.json b/composer.json index 7cda0d1..d69083e 100644 --- a/composer.json +++ b/composer.json @@ -1,14 +1,14 @@ { "name": "silverstripe/comments", "description": "This module provides commenting functionality for Pages and other DataObjects on your SilverStripe site.", - "type": "silverstripe-module", + "type": "silverstripe-vendormodule", "keywords": ["silverstripe", "comments"], "authors": [{ "name": "Will Rossiter", "email": "will@fullscreen.io" }], "require": { - "silverstripe/framework": "^4.0@dev", + "silverstripe/framework": "^4.0", "colymba/gridfield-bulk-editing-tools": "^3.0" }, "suggest": { @@ -22,7 +22,11 @@ "extra": { "branch-alias": { "dev-master": "3.x-dev" - } + }, + "expose": [ + "css", + "javascript" + ] }, "scripts": { "lint": "vendor/bin/phpcs src/ tests/", diff --git a/tests/Stubs/CommentableItemController.php b/tests/Stubs/CommentableItemController.php index 211e20a..ee0538f 100644 --- a/tests/Stubs/CommentableItemController.php +++ b/tests/Stubs/CommentableItemController.php @@ -2,7 +2,6 @@ namespace SilverStripe\Comments\Tests\Stubs; -use SilverStripe\Comments\Tests\Stubs\CommentableItem; use SilverStripe\Control\Controller; use SilverStripe\Dev\TestOnly; diff --git a/tests/Stubs/CommentableItemDisabled.php b/tests/Stubs/CommentableItemDisabled.php index c5c4402..6a7dece 100644 --- a/tests/Stubs/CommentableItemDisabled.php +++ b/tests/Stubs/CommentableItemDisabled.php @@ -2,8 +2,6 @@ namespace SilverStripe\Comments\Tests\Stubs; -use SilverStripe\Comments\Tests\Stubs\CommentableItem; - class CommentableItemDisabled extends CommentableItem { private static $defaults = array( @@ -11,4 +9,6 @@ class CommentableItemDisabled extends CommentableItem 'ModerationRequired' => 'None', 'CommentsRequireLogin' => false ); + + private static $table_name = 'CommentableItemDisabled'; } diff --git a/tests/Stubs/CommentableItemEnabled.php b/tests/Stubs/CommentableItemEnabled.php index 5489827..4b9b766 100644 --- a/tests/Stubs/CommentableItemEnabled.php +++ b/tests/Stubs/CommentableItemEnabled.php @@ -2,8 +2,6 @@ namespace SilverStripe\Comments\Tests\Stubs; -use SilverStripe\Comments\Tests\Stubs\CommentableItem; - class CommentableItemEnabled extends CommentableItem { private static $defaults = array( @@ -11,4 +9,6 @@ class CommentableItemEnabled extends CommentableItem 'ModerationRequired' => 'Required', 'CommentsRequireLogin' => true ); + + private static $table_name = 'CommentableItemEnabled'; }