function EventPropertyAccessTest::provideTestEvent
Same name in this branch
- 8.x-3.x tests/src/Kernel/EventPropertyAccessTest.php \Drupal\Tests\rules\Kernel\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/ Unit/ Integration/ Event/ EventPropertyAccessTest.php, line 92
Class
- EventPropertyAccessTest
- Checks that the events defined in the rules_test_event module are correct.
Namespace
Drupal\Tests\rules\Unit\Integration\EventCode
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(),
],
];
}