SilverLeague\LogViewer\Tests\Forms\GridField\GridFieldClearAllButtonTest
Tests for the "clear all" GridField action class
- Author: Robbie Averill <robbie@averill.co.nz>
Synopsis
class GridFieldClearAllButtonTest
extends SapphireTest
{
- // members
- protected boolean $usesDatabase = true;
- protected GridField $gridField;
- // methods
- public void setUp()
- protected GridFieldClearAllButton getSubject()
- public void testGetHtmlFragments()
- public void testActionsAreDefined()
- public void testCannotClearAllWithoutPermission()
- public void testClearList()
- protected void createDummyLogs()
Hierarchy
Extends
- SilverStripe\Dev\SapphireTest
Members
protected
- $gridField — SilverStripe\Forms\GridField\GridField
-
$usesDatabase
{@inheritDoc}
Methods
protected
- createDummyLogs() — Create a set of dummy LogEntry records
- getSubject() — Return the actual class we're testing
public
- setUp() — {@inheritDoc}
- testActionsAreDefined() — Test that the GridFieldAction actions are returned correctly
- testCannotClearAllWithoutPermission() — Test that an exception is thrown if the Member doesn't have permission to delete the data class assigned
- testClearList() — Test that with permission the list can be cleared
- testGetHtmlFragments() — Ensure that the HTML fragment was pushed correctly and assigned to the specified fragment (in setUp above)