You are here

public function ConfigTest::testGetMessageText in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Composer/Plugin/ProjectMessage/ConfigTest.php \Drupal\Tests\Composer\Plugin\ProjectMessage\ConfigTest::testGetMessageText()

@dataProvider provideGetMessageText @covers ::getText

File

core/tests/Drupal/Tests/Composer/Plugin/ProjectMessage/ConfigTest.php, line 60

Class

ConfigTest
@coversDefaultClass Drupal\Composer\Plugin\ProjectMessage\Message @group ProjectMessage

Namespace

Drupal\Tests\Composer\Plugin\ProjectMessage

Code

public function testGetMessageText($expected, $config) {

  // Root package has our config.
  $root = $this
    ->getMockBuilder(RootPackageInterface::class)
    ->setMethods([
    'getExtra',
  ])
    ->getMockForAbstractClass();
  $root
    ->expects($this
    ->once())
    ->method('getExtra')
    ->willReturn($config);
  $message = new Message($root, 'event-name');
  $this
    ->assertSame($expected, $message
    ->getText());
}