You are here

public function AmountFormatterManagerTest::testGetDefaultPluginId in Currency 8.3

@covers ::getDefaultPluginId

File

tests/src/Unit/Plugin/Currency/AmountFormatter/AmountFormatterManagerTest.php, line 104

Class

AmountFormatterManagerTest
@coversDefaultClass \Drupal\currency\Plugin\Currency\AmountFormatter\AmountFormatterManager

Namespace

Drupal\Tests\currency\Unit\Plugin\Currency\AmountFormatter

Code

public function testGetDefaultPluginId() {
  $plugin_id = $this
    ->randomMachineName();
  $config = $this
    ->getMockBuilder(Config::class)
    ->disableOriginalConstructor()
    ->getMock();
  $config
    ->expects($this
    ->once())
    ->method('get')
    ->with('plugin_id')
    ->willReturn($plugin_id);
  $this->configFactory
    ->expects($this
    ->once())
    ->method('get')
    ->with('currency.amount_formatting')
    ->willReturn($config);
  $this
    ->assertSame($plugin_id, $this->sut
    ->getDefaultPluginId());
}