function EventPropertyAccessTest::provideTestEvent

Same name in this branch
  1. 8.x-3.x tests/src/Unit/Integration/Event/EventPropertyAccessTest.php \Drupal\Tests\rules\Unit\Integration\Event\EventPropertyAccessTest::provideTestEvent()

Provider for events to test.

Passes an event name and an event object for each test case. Here we use all the events defined in the rules_test_event test module.

Return value

array Array of array of values to be passed to our test.

File

tests/src/Kernel/EventPropertyAccessTest.php, line 111

Class

EventPropertyAccessTest
Tests that Rules can use and access the properties of any Events.

Namespace

Drupal\Tests\rules\Kernel

Code

public function provideTestEvent() : array {
    return [
        'Plain event' => [
            'rules_test_event.plain_event',
            new PlainEvent(),
        ],
        'Generic event' => [
            'rules_test_event.generic_event',
            new GenericEvent('Test subject', [
                'publicProperty' => 'public property',
                'protectedProperty' => 'protected property',
                'privateProperty' => 'private property',
            ]),
        ],
        'Getter event' => [
            'rules_test_event.getter_event',
            new GetterEvent(),
        ],
    ];
}