From 20c6ddd354916faab96019f705455bb5d50add66 Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Wed, 28 Mar 2018 10:36:56 +1300 Subject: [PATCH 1/3] Use ModuleResourceLoader for fixtures path This adds the ability to refer to a fixture file path by the ModuleResourceLoader path (e.g protected static $fixture_file = 'vendor/module:tests/fixtures.yml') --- src/Dev/SapphireTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Dev/SapphireTest.php b/src/Dev/SapphireTest.php index 55f1d78c3..3e6805c05 100644 --- a/src/Dev/SapphireTest.php +++ b/src/Dev/SapphireTest.php @@ -37,6 +37,7 @@ use SilverStripe\Security\Member; use SilverStripe\Security\Permission; use SilverStripe\Security\Security; use SilverStripe\View\SSViewer; +use SilverStripe\Core\Manifest\ModuleResourceLoader; if (!class_exists(PHPUnit_Framework_TestCase::class)) { return; @@ -1169,6 +1170,11 @@ class SapphireTest extends PHPUnit_Framework_TestCase implements TestOnly */ protected function resolveFixturePath($fixtureFilePath) { + // support loading via composer name path. + if (strpos($fixtureFilePath, ':') !== false) { + return ModuleResourceLoader::singleton()->resolvePath($fixtureFilePath); + } + // Support fixture paths relative to the test class, rather than relative to webroot // String checking is faster than file_exists() calls. $isRelativeToFile From dd44deacb462d80dbbda507fdb4e9527f049d3bd Mon Sep 17 00:00:00 2001 From: Andreas Lindahl Date: Wed, 28 Mar 2018 16:42:12 +0200 Subject: [PATCH 2/3] Fix for "too few parameters" error when using DBMultiEnum --- src/ORM/FieldType/DBMultiEnum.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ORM/FieldType/DBMultiEnum.php b/src/ORM/FieldType/DBMultiEnum.php index 1b139d56f..4ff6dc322 100644 --- a/src/ORM/FieldType/DBMultiEnum.php +++ b/src/ORM/FieldType/DBMultiEnum.php @@ -11,7 +11,7 @@ use SilverStripe\Forms\CheckboxSetField; */ class DBMultiEnum extends DBEnum { - public function __construct($name, $enum = null, $default = null) + public function __construct($name = null, $enum = null, $default = null) { // MultiEnum needs to take care of its own defaults parent::__construct($name, $enum, null); From c5fcab81df5c3fcb1e2f6388d974fbb63fc1be0b Mon Sep 17 00:00:00 2001 From: Dylan Wagstaff Date: Thu, 29 Mar 2018 12:01:27 +1300 Subject: [PATCH 3/3] Reorder HTML to be semantically correct on render Don't close the unordered list every iteration :) --- templates/SilverStripe/Forms/SelectionGroup.ss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/SilverStripe/Forms/SelectionGroup.ss b/templates/SilverStripe/Forms/SelectionGroup.ss index 8147c9a62..292dceaf2 100644 --- a/templates/SilverStripe/Forms/SelectionGroup.ss +++ b/templates/SilverStripe/Forms/SelectionGroup.ss @@ -6,9 +6,9 @@ $RadioLabel $FieldHolder - <% end_if %> <% end_loop %> + <% else %>
    <% loop $FieldSet %>