\DMSGridFieldAddNewButtonTest
Synopsis
class DMSGridFieldAddNewButtonTest
extends SapphireTest
{
- // members
- protected static string $fixture_file = 'dms/tests/dmstest.yml';
- protected DMSGridFieldAddNewButton $button;
- protected GridField $gridField;
- // methods
- public void setUp()
- public void testNoDocumentSetIdInAddUrlWhenNotProvided()
- public void testDocumentSetIdAddedToLinkWhenProvided()
- public void testPageIdIsAddedWhenAvailableViaDocumentSetRelationship()
- protected string getButtonHtml()
Hierarchy
Extends
- SapphireTest
Members
protected
- $fixture_file
- $gridField — GridField
Methods
protected
- getButtonHtml() — Returns the HTML result of the "add new" button, used for DRY in test class
public
- setUp()
- testDocumentSetIdAddedToLinkWhenProvided() — Test that when a document set ID is provided, it is added onto the "add document" link
- testNoDocumentSetIdInAddUrlWhenNotProvided() — Test that when no document set ID is present then it is not added to the URL for "add document"
- testPageIdIsAddedWhenAvailableViaDocumentSetRelationship() — If a set is saved and associated to a page, that page's ID should be added to the "add document" link to help to ensure the user gets redirected back to the correct place afterwards