UncleCheese\BetterButtons\Tests\Actions\BetterButtonDataObjectTest
Synopsis
class BetterButtonDataObjectTest
extends SapphireTest
{
- // members
- protected boolean $usesDatabase = true;
- protected array $extraDataObjects = ;
- // methods
- public void setUp()
- public void testGetBetterButtonActions()
- public void testAllButtonsImplementInterface()
- public void testInstantiateButtonThrowsExceptionOnInvalidButtonClass()
- public void testButtonDataObjectIsNotVersioned()
- public void tearDown()
Hierarchy
Extends
- SilverStripe\Dev\SapphireTest
Members
protected
- $extraDataObjects
- $usesDatabase
Methods
public
- setUp() — Nest the configuration so that we can play around with it
- tearDown() — Un-nest the configuration - we're finished playing
- testAllButtonsImplementInterface() — Test that all fields in the button FieldList are instances of BetterButtonInterface. Uses the default configuration from _config/config.yml
- testButtonDataObjectIsNotVersioned() — ButtonDataObject is not versioned, so test that checkVersioned reports that too
- testGetBetterButtonActions() — Test that the getBetterButtonsActions method returns a FieldList containing the configured actions for the DataObject
- testInstantiateButtonThrowsExceptionOnInvalidButtonClass() — Test that the instantiateButton method throws an exception if the button could not be created, essentially if there is no injector mapping for the given button name