mirror of
https://github.com/dnadesign/silverstripe-elemental-list.git
synced 2024-10-22 11:05:47 +02:00
Merge pull request #31 from silverstripeltd/pull/github-actions
MNT: Move from Travis to Github Actions. Update min dependencies
This commit is contained in:
commit
065e7b3a80
12
.github/workflows/main.yml
vendored
Normal file
12
.github/workflows/main.yml
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1
|
||||||
|
with:
|
||||||
|
js: false
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.idea/
|
35
.travis.yml
35
.travis.yml
@ -1,35 +0,0 @@
|
|||||||
language: php
|
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- COMPOSER_ROOT_VERSION=1.x-dev
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- php: 5.6
|
|
||||||
env: DB=MYSQL PHPCS_TEST=1 PHPUNIT_TEST=1
|
|
||||||
- php: 7.0
|
|
||||||
env: DB=PGSQL PHPUNIT_TEST=1
|
|
||||||
- php: 7.0
|
|
||||||
env: DB=MYSQL PHPUNIT_TEST=1
|
|
||||||
- php: 7.1
|
|
||||||
env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
# Init PHP
|
|
||||||
- phpenv rehash
|
|
||||||
- phpenv config-rm xdebug.ini
|
|
||||||
|
|
||||||
# Install composer dependencies
|
|
||||||
- composer validate
|
|
||||||
- composer require silverstripe/recipe-cms 1.0.x-dev --no-update
|
|
||||||
- if [[ $DB == PGSQL ]]; then composer require silverstripe/postgresql:2.0.x-dev --no-update; fi
|
|
||||||
- composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile
|
|
||||||
|
|
||||||
script:
|
|
||||||
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit tests/; 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
|
|
||||||
|
|
||||||
after_success:
|
|
||||||
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi
|
|
@ -11,11 +11,13 @@
|
|||||||
"minimum-stability": "dev",
|
"minimum-stability": "dev",
|
||||||
"prefer-stable": true,
|
"prefer-stable": true,
|
||||||
"require": {
|
"require": {
|
||||||
"dnadesign/silverstripe-elemental": ">=3.0",
|
"php": "^7.4 || ^8",
|
||||||
|
"silverstripe/cms": "^4.11",
|
||||||
|
"dnadesign/silverstripe-elemental": "^4",
|
||||||
"silverstripe/vendor-plugin": "^1.0"
|
"silverstripe/vendor-plugin": "^1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^5.7",
|
"silverstripe/recipe-testing": "^2",
|
||||||
"squizlabs/php_codesniffer": "^3.0"
|
"squizlabs/php_codesniffer": "^3.0"
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<phpunit bootstrap="vendor/silverstripe/framework/tests/bootstrap.php" colors="true">
|
<phpunit bootstrap="vendor/silverstripe/framework/tests/bootstrap.php" colors="true">
|
||||||
|
<testsuites>
|
||||||
<testsuite name="Default">
|
<testsuite name="Default">
|
||||||
<directory>tests/php</directory>
|
<directory>tests</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
|
</testsuites>
|
||||||
<filter>
|
<filter>
|
||||||
<whitelist addUncoveredFilesFromWhitelist="true">
|
<whitelist addUncoveredFilesFromWhitelist="true">
|
||||||
<directory suffix=".php">src/</directory>
|
<directory suffix=".php">src/</directory>
|
||||||
<exclude>
|
<exclude>
|
||||||
<directory suffix=".php">tests/php</directory>
|
<directory suffix=".php">tests/</directory>
|
||||||
</exclude>
|
</exclude>
|
||||||
</whitelist>
|
</whitelist>
|
||||||
</filter>
|
</filter>
|
||||||
|
@ -9,12 +9,9 @@ use SilverStripe\Control\Controller;
|
|||||||
use SilverStripe\Core\Extension;
|
use SilverStripe\Core\Extension;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class BaseElementCMSEditLinkExtension
|
|
||||||
*
|
|
||||||
* BaseElement can be nested, CMSEditLink() needs to be updated to reflect that
|
* BaseElement can be nested, CMSEditLink() needs to be updated to reflect that
|
||||||
*
|
*
|
||||||
* @property BaseElementCMSEditLinkExtension|$this $owner
|
* @property BaseElementCMSEditLinkExtension|$this $owner
|
||||||
* @package DNADesign\ElementalList\Extension
|
|
||||||
*/
|
*/
|
||||||
class BaseElementCMSEditLinkExtension extends Extension
|
class BaseElementCMSEditLinkExtension extends Extension
|
||||||
{
|
{
|
||||||
|
@ -7,6 +7,10 @@ use DNADesign\Elemental\Models\ElementalArea;
|
|||||||
use DNADesign\Elemental\Extensions\ElementalAreasExtension;
|
use DNADesign\Elemental\Extensions\ElementalAreasExtension;
|
||||||
use SilverStripe\ORM\FieldType\DBField;
|
use SilverStripe\ORM\FieldType\DBField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property int $ElementsID
|
||||||
|
* @method ElementalArea Elements()
|
||||||
|
*/
|
||||||
class ElementList extends BaseElement
|
class ElementList extends BaseElement
|
||||||
{
|
{
|
||||||
private static $icon = 'font-icon-block-file-list';
|
private static $icon = 'font-icon-block-file-list';
|
||||||
|
@ -7,19 +7,19 @@ use SilverStripe\Dev\SapphireTest;
|
|||||||
|
|
||||||
class ElementListTest extends SapphireTest
|
class ElementListTest extends SapphireTest
|
||||||
{
|
{
|
||||||
public function testGetRelations()
|
public function testGetRelations(): void
|
||||||
{
|
{
|
||||||
$list = ElementList::create();
|
$list = ElementList::create();
|
||||||
|
|
||||||
$this->assertEquals(['Elements'], $list->getElementalRelations());
|
$this->assertEquals(['Elements'], $list->getElementalRelations());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetCmsFields()
|
public function testGetCmsFields(): void
|
||||||
{
|
{
|
||||||
// todo
|
// todo
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testForTemplate()
|
public function testForTemplate(): void
|
||||||
{
|
{
|
||||||
// todo
|
// todo
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user