function ReactionRuleConfigTest::addEventDataProvider

Data provider for ::testAddEvent().

File

tests/src/Unit/Entity/ReactionRuleConfigTest.php, line 85

Class

ReactionRuleConfigTest
@coversDefaultClass \Drupal\rules\Entity\ReactionRuleConfig @group Rules

Namespace

Drupal\Tests\rules\Unit\Entity

Code

public function addEventDataProvider() {
    return [
        'no events' => [
            'expected' => [
                [
                    'event_name' => 'foo',
                ],
            ],
            'events_init' => [],
            'event_add' => [
                'event_name' => 'foo',
            ],
        ],
        'single event' => [
            'expected' => [
                [
                    'event_name' => 'foo',
                ],
                [
                    'event_name' => 'bar',
                ],
            ],
            'events_init' => [
                [
                    'event_name' => 'foo',
                ],
            ],
            'event_add' => [
                'event_name' => 'bar',
            ],
        ],
        'with config' => [
            'expected' => [
                [
                    'event_name' => 'foo',
                ],
                [
                    'event_name' => 'bar',
                    'configuration' => [
                        'qux' => 'baz',
                    ],
                ],
            ],
            'events_init' => [
                [
                    'event_name' => 'foo',
                ],
            ],
            'event_add' => [
                'event_name' => 'bar',
                'configuration' => [
                    'qux' => 'baz',
                ],
            ],
        ],
        'duplicate event' => [
            'expected' => [
                [
                    'event_name' => 'foo',
                ],
            ],
            'events_init' => [
                [
                    'event_name' => 'foo',
                ],
            ],
            'event_add' => [
                'event_name' => 'foo',
            ],
        ],
    ];
}