mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
FIX Ensure DMSUploadField called via injection is returned correctly
Fixes an incompatibility with SelectUploadField in CWP
This commit is contained in:
parent
e2eead8888
commit
ac5a01614b
@ -10,3 +10,7 @@ SiteTree:
|
||||
HtmlEditorField_Toolbar:
|
||||
extensions:
|
||||
- DocumentHtmlEditorFieldToolbar
|
||||
|
||||
# Ensure that if the parent UploadField is overloaded with the injector, that the DMSUploadField is returned
|
||||
Injector:
|
||||
DMSUploadField: DMSUploadField
|
||||
|
@ -14,6 +14,15 @@ class DMSUploadFieldTest extends SapphireTest
|
||||
$this->field = new DMSUploadField('StubUploadField');
|
||||
}
|
||||
|
||||
/**
|
||||
* SS 3.x injector will return an overloaded parent of a child class if the child is not injected.
|
||||
* This is a sanity check.
|
||||
*/
|
||||
public function testDmsUploadFieldIsInjectable()
|
||||
{
|
||||
$this->assertInstanceOf('DMSUploadField', DMSUploadField::create('Stub'));
|
||||
}
|
||||
|
||||
/**
|
||||
* The validator is coded to always return true. Replace this test if this behaviour changes in future.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user