Merge branch '2.4' into 2

This commit is contained in:
Steve Boyd 2020-06-18 13:38:00 +12:00
commit 2830b221f1
3 changed files with 18 additions and 7 deletions

View File

@ -4,27 +4,30 @@ dist: trusty
env:
global:
- COMPOSER_ROOT_VERSION=2.0.x-dev
- COMPOSER_ROOT_VERSION=2.x-dev
- TRAVIS_NODE_VERSION="6"
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.1
env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1
- php: 7.1
env: DB=MYSQL NPM_TEST=1
- php: 7.2
env: DB=PGSQL PHPUNIT_TEST=1
- php: 7.3
env: DB=MYSQL PHPUNIT_TEST=1NPM_TEST=1
- php: 7.4
env: DB=MYSQL PHPUNIT_TEST=1 NPM_TEST=1
before_script:
- phpenv rehash
- phpenv config-rm xdebug.ini
- composer validate
- composer require --no-update silverstripe/recipe-cms:4.3.x-dev silverstripe/admin:1.3.x-dev
- if [[ $DB == PGSQL ]]; then composer require --no-update silverstripe/postgresql:2.1.x-dev; fi
- composer require --no-update silverstripe/recipe-cms:^4
- if [[ $DB == PGSQL ]]; then composer require --no-update silverstripe/postgresql:^2; fi
- composer require --no-update sminnee/phpunit-mock-objects:^3
- composer install --prefer-source --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile
# Install NPM dependencies

View File

@ -525,6 +525,8 @@ class TagField extends MultiSelectField
/** @var ReadonlyTagField $copy */
$copy = $this->castedCopy(ReadonlyTagField::class);
$copy->setSourceList($this->getSourceList());
$copy->setTitleField($this->getTitleField());
return $copy;
}

View File

@ -352,6 +352,12 @@ class TagFieldTest extends SapphireTest
$field = new TagField('Tags', '', TagFieldTestBlogTag::get());
$readOnlyField = $field->performReadonlyTransformation();
$this->assertInstanceOf(ReadonlyTagField::class, $readOnlyField);
// Custom title field
$field = new TagField('Tags', '', TagFieldTestBlogTag::get());
$field->setTitleField('Name');
$readOnlyField = $field->performReadonlyTransformation();
$this->assertEquals('Name', $readOnlyField->getTitleField());
}
public function testGetSchemaDataDefaults()