You are here

public function RulesActionBaseTest::testTranslatedLabel in Rules 8.3

Tests that a translation wrapper label is correctly parsed.

@covers ::summary

File

tests/src/Unit/RulesActionBaseTest.php, line 49

Class

RulesActionBaseTest
@coversDefaultClass \Drupal\rules\Core\RulesActionBase @group Rules

Namespace

Drupal\Tests\rules\Unit

Code

public function testTranslatedLabel() {
  $translation_wrapper = $this
    ->prophesize(TranslatableMarkup::class);
  $translation_wrapper
    ->__toString()
    ->willReturn('something');
  $rules_action_base = $this
    ->getMockForAbstractClass(RulesActionBase::class, [
    [],
    '',
    [
      'label' => $translation_wrapper
        ->reveal(),
    ],
  ]);
  $this
    ->assertEquals('something', $rules_action_base
    ->summary());
}