function ReactionRuleConfigTest::testGetEvents

@covers ::getEvents

File

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

Class

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

Namespace

Drupal\Tests\rules\Unit\Entity

Code

public function testGetEvents() {
    // Create a rule with a few events.
    $rule = $this->createRule([
        'events' => [
            [
                'event_name' => 'foo',
            ],
            [
                'event_name' => 'bar',
                'configuration' => [
                    'qux' => 'baz',
                ],
            ],
        ],
    ]);
    $expected = [
        [
            'event_name' => 'foo',
        ],
        [
            'event_name' => 'bar',
            'configuration' => [
                'qux' => 'baz',
            ],
        ],
    ];
    $this->assertSame($expected, $rule->getEvents());
}