mirror of
https://github.com/UndefinedOffset/SortableGridField.git
synced 2024-10-22 17:05:38 +02:00
Updated PHPUnit config
Added phpcs config Added GitHub Actions badge Re-organized tests folder
This commit is contained in:
parent
c965eb0c2e
commit
e1b1bbf8b3
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@ -90,7 +90,7 @@ jobs:
|
|||||||
- name: Perform PHPUnit Tests
|
- name: Perform PHPUnit Tests
|
||||||
env:
|
env:
|
||||||
SS_DATABASE_PORT: ${{ job.services.mysql.ports['3306'] }}
|
SS_DATABASE_PORT: ${{ job.services.mysql.ports['3306'] }}
|
||||||
run: vendor/bin/phpunit --colors=always --printer UndefinedOffset\\SortableGridField\\Tests\\Bootstrap\\GitHubActionsAnnotatorPrinter
|
run: vendor/bin/phpunit --colors=always --printer UndefinedOffset\\SortableGridField\\Tests\\PHPUnit\\Bootstrap\\GitHubActionsAnnotatorPrinter
|
||||||
|
|
||||||
silverstripe_410_php80:
|
silverstripe_410_php80:
|
||||||
name: "Silverstripe 4.10 | PHP 8.0"
|
name: "Silverstripe 4.10 | PHP 8.0"
|
||||||
@ -167,7 +167,7 @@ jobs:
|
|||||||
- name: Perform PHPUnit Tests
|
- name: Perform PHPUnit Tests
|
||||||
env:
|
env:
|
||||||
SS_DATABASE_PORT: ${{ job.services.mysql.ports['3306'] }}
|
SS_DATABASE_PORT: ${{ job.services.mysql.ports['3306'] }}
|
||||||
run: vendor/bin/phpunit --colors=always --printer UndefinedOffset\\SortableGridField\\Tests\\Bootstrap\\GitHubActionsAnnotatorPrinter
|
run: vendor/bin/phpunit --colors=always --printer UndefinedOffset\\SortableGridField\\Tests\\PHPUnit\\Bootstrap\\GitHubActionsAnnotatorPrinter
|
||||||
|
|
||||||
silverstripe_49_php74:
|
silverstripe_49_php74:
|
||||||
name: "Silverstripe 4.9 | PHP 7.4"
|
name: "Silverstripe 4.9 | PHP 7.4"
|
||||||
@ -244,7 +244,7 @@ jobs:
|
|||||||
- name: Perform PHPUnit Tests
|
- name: Perform PHPUnit Tests
|
||||||
env:
|
env:
|
||||||
SS_DATABASE_PORT: ${{ job.services.mysql.ports['3306'] }}
|
SS_DATABASE_PORT: ${{ job.services.mysql.ports['3306'] }}
|
||||||
run: vendor/bin/phpunit --colors=always --printer UndefinedOffset\\SortableGridField\\Tests\\Bootstrap\\GitHubActionsAnnotatorPrinter
|
run: vendor/bin/phpunit --colors=always --printer UndefinedOffset\\SortableGridField\\Tests\\PHPUnit\\Bootstrap\\GitHubActionsAnnotatorPrinter
|
||||||
|
|
||||||
phpcs:
|
phpcs:
|
||||||
name: "PHP_CodeSniffer"
|
name: "PHP_CodeSniffer"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
SortableGridField
|
SortableGridField
|
||||||
=================
|
=================
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.org/UndefinedOffset/SortableGridField.png)](https://travis-ci.org/UndefinedOffset/SortableGridField)
|
[![CI](https://github.com/UndefinedOffset/SortableGridField/actions/workflows/ci.yml/badge.svg)](https://github.com/UndefinedOffset/SortableGridField/actions/workflows/ci.yml)
|
||||||
|
|
||||||
Adds drag and drop functionality to SilverStripe 4's GridField
|
Adds drag and drop functionality to SilverStripe 4's GridField
|
||||||
|
|
||||||
|
49
phpcs.xml.dist
Normal file
49
phpcs.xml.dist
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
<?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.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" />
|
||||||
|
<exclude name="PSR2.ControlStructures.ElseIfDeclaration" />
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
<rule ref="Squiz.Strings.ConcatenationSpacing">
|
||||||
|
<properties>
|
||||||
|
<property name="spacing" value="1" />
|
||||||
|
<property name="ignoreNewlines" value="true"/>
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
<rule ref="PEAR.ControlStructures.MultiLineCondition" />
|
||||||
|
|
||||||
|
<rule ref="Generic.Formatting.SpaceAfterCast" />
|
||||||
|
<rule ref="Generic.Arrays.DisallowLongArraySyntax.Found">
|
||||||
|
<type>warning</type>
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
<rule ref="Squiz.Arrays.ArrayDeclaration.NoComma" />
|
||||||
|
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
|
||||||
|
<properties>
|
||||||
|
<property name="ignoreNewlines" value="true" />
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
<rule ref="PSR12.Functions.ReturnTypeDeclaration" />
|
||||||
|
|
||||||
|
<!-- include php files only -->
|
||||||
|
<arg name="extensions" value="php,lib,inc,php5"/>
|
||||||
|
|
||||||
|
<file>./src</file>
|
||||||
|
<file>./tests</file>
|
||||||
|
<file>./_config.php</file>
|
||||||
|
</ruleset>
|
||||||
|
|
@ -1,5 +1,27 @@
|
|||||||
<phpunit bootstrap="vendor/silverstripe/framework/tests/bootstrap.php" colors="true">
|
<?xml version="1.0"?>
|
||||||
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/silverstripe/framework/tests/bootstrap.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
|
||||||
|
<testsuites>
|
||||||
<testsuite name="Default">
|
<testsuite name="Default">
|
||||||
<directory>tests/</directory>
|
<directory suffix=".php">tests/PHPUnit</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
|
</testsuites>
|
||||||
|
|
||||||
|
<groups>
|
||||||
|
<exclude>
|
||||||
|
<group>sanitychecks</group>
|
||||||
|
</exclude>
|
||||||
|
</groups>
|
||||||
|
|
||||||
|
<coverage includeUncoveredFiles="true">
|
||||||
|
<include>
|
||||||
|
<directory suffix=".php">src/</directory>
|
||||||
|
</include>
|
||||||
|
<exclude>
|
||||||
|
<directory suffix=".php">tests/</directory>
|
||||||
|
</exclude>
|
||||||
|
</coverage>
|
||||||
|
|
||||||
|
<php>
|
||||||
|
<get name="flush" value="1"/>
|
||||||
|
</php>
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace UndefinedOffset\SortableGridField\Tests\Bootstrap;
|
namespace UndefinedOffset\SortableGridField\Tests\PHPUnit\Bootstrap;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestFailure;
|
use PHPUnit\Framework\TestFailure;
|
||||||
use PHPUnit\TextUI\DefaultResultPrinter;
|
use PHPUnit\TextUI\DefaultResultPrinter;
|
15
tests/utils/actions.env.template
Normal file
15
tests/utils/actions.env.template
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
SS_ENVIRONMENT_TYPE="dev"
|
||||||
|
SS_TRUSTED_PROXY_IPS="*"
|
||||||
|
|
||||||
|
SS_DATABASE_CLASS="MySQLPDODatabase"
|
||||||
|
SS_DATABASE_SERVER="127.0.0.1"
|
||||||
|
SS_DATABASE_USERNAME="root"
|
||||||
|
SS_DATABASE_PASSWORD="testpassword"
|
||||||
|
SS_DATABASE_NAME="test_db"
|
||||||
|
|
||||||
|
SS_DEFAULT_ADMIN_USERNAME="username"
|
||||||
|
SS_DEFAULT_ADMIN_PASSWORD="password"
|
||||||
|
|
||||||
|
SS_ERROR_LOG="artifacts/silverstripe-errors.log"
|
||||||
|
|
||||||
|
TRAVIS_TEST_SESSION="1"
|
Loading…
Reference in New Issue
Block a user