mirror of
https://github.com/UndefinedOffset/SortableGridField.git
synced 2024-10-22 17:05:38 +02:00
Enabled Silverstripe 5 testing
Adjusted composer requirements to allow Silverstripe 5 Replaced some deprecated api calls
This commit is contained in:
parent
c3915cc2b8
commit
29957be873
16
.github/workflows/ci.yml
vendored
16
.github/workflows/ci.yml
vendored
@ -15,12 +15,12 @@ on:
|
||||
|
||||
|
||||
jobs:
|
||||
silverstripe_411_php74:
|
||||
name: "Silverstripe 4.11 | PHP 7.4"
|
||||
silverstripe_5_php81:
|
||||
name: "Silverstripe 5.0 | PHP 8.1"
|
||||
runs-on: ubuntu-latest
|
||||
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
|
||||
env:
|
||||
php_version: 7.4
|
||||
php_version: 8.1
|
||||
php_extensions: ctype, dom, fileinfo, hash, intl, mbstring, session, simplexml, tokenizer, xml, pdo, mysqli, gd, zip
|
||||
services:
|
||||
mysql:
|
||||
@ -69,8 +69,8 @@ jobs:
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-composer-ss411-php74-${{ hashFiles('**/composer.json') }}-${{ hashFiles('.github/workflows/ci.yml') }}
|
||||
restore-keys: ${{ runner.os }}-composer-ss411-php74-
|
||||
key: ${{ runner.os }}-composer-ss5-php81-${{ hashFiles('**/composer.json') }}-${{ hashFiles('.github/workflows/ci.yml') }}
|
||||
restore-keys: ${{ runner.os }}-composer-ss5-php81-
|
||||
|
||||
- name: Install Composer dependencies
|
||||
env:
|
||||
@ -78,8 +78,8 @@ jobs:
|
||||
run: |
|
||||
composer self-update --ansi || true
|
||||
if [[ $GITHUB_ACCESS_TOKEN ]]; then composer config --ansi -g github-oauth.github.com $GITHUB_ACCESS_TOKEN; fi
|
||||
composer require silverstripe/admin 1.11.* --no-update
|
||||
composer require silverstripe/versioned 1.11.*
|
||||
composer require silverstripe/admin 2.0.* --no-update
|
||||
composer require silverstripe/versioned 2.0.*
|
||||
composer install --verbose --no-interaction --no-progress --no-suggest --optimize-autoloader --ansi
|
||||
|
||||
- name: Configure Environment
|
||||
@ -177,7 +177,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
|
||||
env:
|
||||
php_version: 7.4
|
||||
php_version: 8.0
|
||||
php_extensions: ctype, dom, fileinfo, hash, intl, mbstring, session, simplexml, tokenizer, xml, pdo, mysqli, gd, zip
|
||||
|
||||
steps:
|
||||
|
@ -12,9 +12,8 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"silverstripe/framework": "~4.11",
|
||||
"silverstripe/versioned": "^1.0",
|
||||
"silverstripe/vendor-plugin": "^1.0"
|
||||
"silverstripe/framework": "~4.11 | ^5",
|
||||
"silverstripe/versioned": "^1 | ^2"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.5",
|
||||
|
@ -223,7 +223,7 @@ class GridFieldSortableRows extends AbstractGridFieldComponent implements GridFi
|
||||
$list = clone $dataList;
|
||||
$list = $list->alterDataQuery(function ($query, SS_List $tmplist) {
|
||||
/** @var \SilverStripe\ORM\DataQuery $query */
|
||||
$query->limit([]);
|
||||
$query->limit(null);
|
||||
return $query;
|
||||
});
|
||||
|
||||
|
@ -111,7 +111,7 @@ class AutoSortTest extends SapphireTest
|
||||
|
||||
//Publish all records
|
||||
foreach ($list as $item) {
|
||||
$item->publish('Stage', 'Live');
|
||||
$item->publishSingle();
|
||||
}
|
||||
|
||||
|
||||
@ -168,7 +168,7 @@ class AutoSortTest extends SapphireTest
|
||||
|
||||
//Publish all records
|
||||
foreach ($list as $item) {
|
||||
$item->publish('Stage', 'Live');
|
||||
$item->publishSingle();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace UndefinedOffset\SortableGridField\Tests;
|
||||
|
||||
use SilverStripe\Core\Injector\Injector;
|
||||
use SilverStripe\Control\Controller;
|
||||
use SilverStripe\Control\HTTPRequest;
|
||||
use SilverStripe\Dev\SapphireTest;
|
||||
@ -9,7 +10,8 @@ use SilverStripe\Forms\Form;
|
||||
use SilverStripe\Forms\GridField\GridField;
|
||||
use SilverStripe\Forms\GridField\GridFieldConfig;
|
||||
use SilverStripe\ORM\ValidationException;
|
||||
use SilverStripe\Security\Member;
|
||||
use SilverStripe\Security\IdentityStore;
|
||||
use SilverStripe\Security\Security;
|
||||
use SilverStripe\Versioned\Versioned;
|
||||
use UndefinedOffset\SortableGridField\Forms\GridFieldSortableRows;
|
||||
use UndefinedOffset\SortableGridField\Tests\Forms\AutoSortTest\DummyController;
|
||||
@ -48,8 +50,8 @@ class OrderingTest extends SapphireTest
|
||||
|
||||
public function testSortActionWithoutCorrectPermission()
|
||||
{
|
||||
if (Member::currentUser()) {
|
||||
Member::currentUser()->logOut();
|
||||
if (Security::getCurrentUser()) {
|
||||
Injector::inst()->get(IdentityStore::class)->logOut(Controller::curr()->getRequest());
|
||||
}
|
||||
|
||||
$this->expectException(ValidationException::class);
|
||||
@ -97,7 +99,7 @@ class OrderingTest extends SapphireTest
|
||||
|
||||
//Publish all records
|
||||
foreach ($list as $item) {
|
||||
$item->publish('Stage', 'Live');
|
||||
$item->publishSingle();
|
||||
}
|
||||
|
||||
$team1 = $this->objFromFixture(VTeam::class, 'team1');
|
||||
|
@ -107,7 +107,7 @@ class PageSortingTest extends SapphireTest
|
||||
|
||||
//Publish all records
|
||||
foreach ($list as $item) {
|
||||
$item->publish('Stage', 'Live');
|
||||
$item->publishSingle();
|
||||
}
|
||||
|
||||
|
||||
@ -154,7 +154,7 @@ class PageSortingTest extends SapphireTest
|
||||
|
||||
//Publish all records
|
||||
foreach ($list as $item) {
|
||||
$item->publish('Stage', 'Live');
|
||||
$item->publishSingle();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user